Hello, while testing some gated semantic predicate: address @init{int n=1;}: ( {n<=12}?=> c=CHAR {n++;} )+ { // check for address validity final String t = $address.text; if( t.length() != 12 ) { throw new InvalidSWIFTBlock1AddressException( t, $c.getLine(), $c.getCharPositionInLine() ); } } ; catch[MismatchedTokenException mte] { throw new InvalidSWIFTBlock1AddressException( mte.token.getText(), mte.line, mte.charPositionInLine ); }
I encoutered problem after Java source generation: class DFA1 extends DFA { public DFA1(BaseRecognizer recognizer) { this.recognizer = recognizer; this.decisionNumber = 1; this.eot = DFA1_eot; this.eof = DFA1_eof; this.min = DFA1_min; this.max = DFA1_max; this.accept = DFA1_accept; this.special = DFA1_special; this.transition = DFA1_transition; } public String getDescription() { return "()+ loopback of 67:1: ({...}? =>c= CHAR )+"; } public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { TokenStream input = (TokenStream)_input; int _s = s; switch ( s ) { case 0 : int LA1_23 = input.LA(1); int index1_23 = input.index(); input.rewind(); s = -1; if ( (LA1_23==CHAR) ) {s = 24;} else if ( (LA1_23==12) && ((n<=12))) {s = 14;} The Java compiler says: SWIFTMTParser.java:865: cannot find symbol symbol : variable n location: class com.bnpparibas.acetp.foxhound.spec2009.parser.SWIFTMTParser.DFA1 else if ( (LA1_23==12) && ((n<=12))) {s = 14;} I've tried to modify something using -Xminswitchalts 100 but I don't know what to do to correct this issue. Is it a known antlr bug? Regards, Loïc This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. Do not print this message unless it is necessary, consider the environment. --------------------------------------------- Ce message et toutes les pieces jointes (ci-apres le "message") sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie. N'imprimez ce message que si necessaire, pensez a l'environnement. -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address