Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    [ANTLR] Problema durante compilazione

    Ciao a tutti, devo usare antlr per l'università ma non so se l'ho installato bene.
    Premetto che sto usando Windows 7 64 bit.
    Ho scaricato da http://www.antlr3.org/download/antlr-3.5-complete.jar la versione 3.5 di antlr e da http://www.antlr3.org/download/antlrworks-1.4.2.jar antlrwork 1.4.2.
    Poi ho messo questi due file in una cartella C:\Javalib ed ho impostato il classpath aggiungendo C:\Javalib\antlr-3.5-complete.jar; alla variabile d'ambiente Path (è la stessa a cui ho aggiunto anche il percorso delle jkd di java).
    Poi, per esempio, ho provato a seguire i passi descritti qui http://www.antlr.org/wiki/display/AN...ion+evaluator.
    Quindi ho copiato il testo della grammatica in un file Expr.g e l'ho salvato sempre nella cartella C:\Javalib.
    Poi dal prompt dei comandi ho eseguito (trovandomi in C:\Javalib) java -cp antlr-3.5-complete.jar org.antlr.Tool Expr.g ed effettivamente mi ha prodotto i 3 file ExprLexer.java, ExprParser.java e Expr.tokens.
    Fin qui quindi tutto bene...
    Ora iniziano i problemi.
    Ho poi copiato in un file java il programmino Test.java e ho provato a compilarlo eseguendo dal prompt dei comandi (dopo essermi posizionato nella cartella C:\Javalib) javac Test.java ExprLexer.java ExprParser.java ma mi da errore, anzi.. mi da 100 errori.
    Ho provato allora scrivendo sul prompt javac -cp .:.\antlr-3.5-complete.jar Test.java ExprLexer.java ExprParser.java e javac -cp .;C:\antlr-3.5-complete.jar Test.java ExprLexer.java ExprParser.java ma niente, sempre gli stessi 100 errori.

    Ho installato bene tutto? Le variabili d'ambiente sono corrette? Come faccio a compilare?

    Grazie infinite!

  2. #2
    Ci puoi elencare qualcuno di questi 100 errori?
    Ad esempio il primo.

    Ciao
    I computer sono incredibilmente veloci, accurati e stupidi.
    Gli uomini sono incredibilmente lenti, inaccurati e intelligenti.
    Insieme sono una potenza che supera l'immaginazione.

    A.Einstein

  3. #3
    Grazie per la risposta. Ecco alcuni degli errori:
    codice:
    symbol: class MismatchedSetException
    location: class ExprLexer
    ExprLexer.java:183: error: cannot find symbol
    MismatchedSetException mse = new
    MismatchedSetException(null,input);
    
    ^
    symbol: class MismatchedSetException
    location: class ExprLexer
    ExprLexer.java:183: error: cannot find symbol
    MismatchedSetException mse = new
    MismatchedSetException(null,input);
    
    ^
    symbol: variable input
    location: class ExprLexer
    ExprLexer.java:192: error: cannot find symbol
    EarlyExitException eee = new EarlyExitEx
    ception(1, input);
    ^
    symbol: class EarlyExitException
    location: class ExprLexer
    ExprLexer.java:192: error: cannot find symbol
    EarlyExitException eee = new EarlyExitEx
    ception(1, input);
    ^
    symbol: class EarlyExitException
    location: class ExprLexer
    ExprLexer.java:192: error: cannot find symbol
    EarlyExitException eee = new EarlyExitEx
    ception(1, input);
    
    ^
    symbol: variable input
    location: class ExprLexer
    ExprLexer.java:200: error: cannot find symbol
    state.type = _type;
    ^
    symbol: variable state
    location: class ExprLexer
    ExprLexer.java:201: error: cannot find symbol
    state.channel = _channel;
    ^
    symbol: variable state
    location: class ExprLexer
    ExprLexer.java:213: error: cannot find symbol
    int _channel = DEFAULT_TOKEN_CHANNEL;
    ^
    symbol: variable DEFAULT_TOKEN_CHANNEL
    location: class ExprLexer
    ExprLexer.java:222: error: cannot find symbol
    int LA2_0 = input.LA(1);
    ^
    symbol: variable input
    location: class ExprLexer
    ExprLexer.java:231: error: cannot find symbol
    if ( (input.LA(1) >= '0' && input.LA(1)
    <= '9') ) {
    ^
    symbol: variable input
    location: class ExprLexer
    ExprLexer.java:231: error: cannot find symbol
    if ( (input.LA(1) >= '0' && input.LA(1)
    <= '9') ) {
    ^
    symbol: variable input
    location: class ExprLexer
    100 errors

  4. #4
    Non sono ancora riuscito a risolvere..

  5. #5
    Nessuno mi sa aiutare gentilmente?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.