Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo #4756

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

typo #4756

wants to merge 1 commit into from

Conversation

OndrejPopp
Copy link

Ok, my first contribution to antlr. So what's the deal? I don't like running antlr through python, but I needed to download it anyway to figure out how to run antlr4-parse. Maybe that should be somewhere in the docs, because now it only says to use python... So I needed to do that, and then it said,

java org.antlr.v4.gui.Intrepreter [X.g4|XParser.g4 XLexer.g4] startRuleName
[-tokens] [-tree] [-gui] [-encoding encodingname]
[-trace] [-profile filename.csv] [input-filename(s)]
Omitting input-filename makes rig read from stdin.

Ok, good! Tx python!

So I tried that, and then it didn't work because the class name is not Intrepreter but Interpreter. So everyone who copies this from the terminal just like I did because he or she whats to be able to run the tools directly and not through python will fail... So I fixed that, so now it says,

java org.antlr.v4.gui.Interpreter [X.g4|XParser.g4 XLexer.g4] startRuleName
[-tokens] [-tree] [-gui] [-encoding encodingname]
[-trace] [-profile filename.csv] [input-filename(s)]
Omitting input-filename makes rig read from stdin.

Ok that's it!

Kind regards,
Ondrej

P.S, Tx for the antlr-parse tool, and the Cxx 14 grammar. I needed that to figure out parse traces from the C++ grammar... So I am going to gave a look at that now, Tx!

Signed-off-by: Ondrej Popp <[email protected]>
@OndrejPopp
Copy link
Author

Ok, I did it, tx! exactly what I needed, (I renamed antlr4-parse to antlr-parse in my own script)
but then... Tx!

antlr-parse CPP14Lexer.g4 CPP14Parser.g4 translationUnit -trace
int i;
enter translationUnit, LT(1)=int
enter declarationseq, LT(1)=int
enter declaration, LT(1)=int
enter blockDeclaration, LT(1)=int
enter simpleDeclaration, LT(1)=int
enter declSpecifierSeq, LT(1)=int
enter declSpecifier, LT(1)=int
enter typeSpecifier, LT(1)=int
enter trailingTypeSpecifier, LT(1)=int
enter simpleTypeSpecifier, LT(1)=int
consume [@0,0:2='int',<45>,1:0] rule simpleTypeSpecifier
exit simpleTypeSpecifier, LT(1)=i
exit trailingTypeSpecifier, LT(1)=i
exit typeSpecifier, LT(1)=i
exit declSpecifier, LT(1)=i
exit declSpecifierSeq, LT(1)=i
enter initDeclaratorList, LT(1)=i
enter initDeclarator, LT(1)=i
enter declarator, LT(1)=i
enter pointerDeclarator, LT(1)=i
enter noPointerDeclarator, LT(1)=i
enter declaratorid, LT(1)=i
enter idExpression, LT(1)=i
enter unqualifiedId, LT(1)=i
consume [@1,4:4='i',<132>,1:4] rule unqualifiedId
exit unqualifiedId, LT(1)=;
exit idExpression, LT(1)=;
exit declaratorid, LT(1)=;
exit noPointerDeclarator, LT(1)=;
exit pointerDeclarator, LT(1)=;
exit declarator, LT(1)=;
exit initDeclarator, LT(1)=;
exit initDeclaratorList, LT(1)=;
consume [@2,5:5=';',<128>,1:5] rule simpleDeclaration
exit simpleDeclaration, LT(1)=
exit blockDeclaration, LT(1)=
exit declaration, LT(1)=
exit declarationseq, LT(1)=
consume [@3,7:6='',<-1>,2:0] rule translationUnit
exit translationUnit, LT(1)=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant