Created
August 31, 2014 11:44
-
-
Save 166MMX/2f4fb04313794e3572ae to your computer and use it in GitHub Desktop.
NullPointerException https://github.com/antlr/antlr3/issues/162
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error(100): jconfig/src/main/antlr3/com/initvoid/jconfig/zconf/ZConfHelpLexer.g:17:1: syntax error: antlr: org.antlr.runtime.EarlyExitException | |
context [anonymous] 1:10 attribute rules isn't defined | |
error(100): jconfig/src/main/antlr3/com/initvoid/jconfig/zconf/ZConfHelpLexer.g:0:1: syntax error: assign.types: org.antlr.runtime.EarlyExitException | |
org/antlr/grammar/v3/DefineGrammarItemsWalker.g: node from line 109:4 required (...)+ loop did not match anything at input ';' | |
error(10): internal error: jconfig/src/main/antlr3/com/initvoid/jconfig/zconf/ZConfHelpLexer.g : java.lang.NullPointerException | |
org.antlr.grammar.v3.CodeGenTreeWalker.rules(CodeGenTreeWalker.java:901) | |
org.antlr.grammar.v3.CodeGenTreeWalker.grammarSpec(CodeGenTreeWalker.java:877) | |
org.antlr.grammar.v3.CodeGenTreeWalker.grammar_(CodeGenTreeWalker.java:479) | |
org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:415) | |
org.antlr.Tool.generateRecognizer(Tool.java:674) | |
org.antlr.Tool.process(Tool.java:487) | |
org.antlr.Tool.main(Tool.java:98) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lexer grammar ZConfHelpLexer; | |
options { | |
language=Java; | |
} | |
@lexer::header {package com.initvoid.jconfig.zconf;} | |
//input : lines EOF ; | |
//lines : line+ content? ; | |
//line : content? HELP_EOL ; | |
//content : HELP_LEADING_WS HELP_TEXT ; | |
tokens { | |
T_MAINMENU ; | |
T_MENU ; | |
T_ENDMENU ; | |
T_SOURCE ; | |
T_CHOICE ; | |
T_ENDCHOICE ; | |
T_COMMENT ; | |
T_CONFIG ; | |
T_MENUCONFIG ; | |
T_HELP ; | |
T_IF ; | |
T_ENDIF ; | |
T_DEPENDS ; | |
T_OPTIONAL ; | |
T_DEFAULT ; | |
T_PROMPT ; | |
T_TYPE_TRISTATE ; | |
T_DEFAULT_TRISTATE ; | |
T_TYPE_BOOL ; | |
T_TYPE_BOOLEAN ; | |
T_DEFAULT_BOOL ; | |
T_TYPE_INT ; | |
T_TYPE_HEX ; | |
T_TYPE_STRING ; | |
T_SELECT ; | |
T_RANGE ; | |
T_VISIBLE ; | |
T_OPTION ; | |
T_ON ; | |
T_OPT_MODULES ; | |
T_OPT_DEFCONFIG_LIST ; | |
T_OPT_ENV ; | |
T_OPT_ALLNOCONFIG_Y ; | |
T_AND ; | |
T_OR ; | |
T_OPEN_PAREN ; | |
T_CLOSE_PAREN ; | |
T_NOT ; | |
T_EQUAL ; | |
T_UNEQUAL ; | |
T_DQUOT ; | |
T_SQUOT ; | |
T_FOLD; | |
T_EOL; | |
T_WORD; | |
T_WORD_QUOTE; | |
} | |
HELP_LEADING_WS | |
@init { | |
int spaces = 0; | |
StringBuilder sb = new StringBuilder(); | |
} | |
@after { | |
while (spaces > 0) | |
{ | |
if (spaces > 8) | |
{ sb.append(" "); spaces -= 8; } | |
else | |
{ sb.append(" "); spaces--; } | |
} | |
emit(new ClassicToken(HELP_LEADING_WS, sb.toString())); | |
} | |
: { getCharPositionInLine() == 0 }?=> | |
( ' ' { spaces++; } | |
| '\t' { spaces += 8; spaces -= (spaces \% 8); } | |
)+ | |
; | |
HELP_TEXT | |
: ( options { greedy = false; }: | |
~( ' ' | |
| '\t' | |
| '\r\n' | |
| '\n' | |
) | |
) | |
( options { greedy = true; }: | |
~( '\r\n' | |
| '\n' | |
) | |
)* | |
; | |
HELP_EOL | |
: ( '\r\n' | |
| '\n' | |
) { input.mark(); } | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment