For grammar:
grammar qwe;
query
: COLUMN OPERATOR value EOF
;
COLUMN
: [a-z_]+
;
OPERATOR
: ('='|'>'|'<')
;
SCALAR
: [a-z_]+
;
value
: SCALAR
;
WS : [ \t\r\n]+ -> skip ;
there are identical rules COLUMN
and SCALAR
. Here I was advised to use grun
aliases.
I installed it for my Ubuntu. And for folders structure:
ran this from project learning_antlr4
level:
grun qwe tokens -tokens < qwe/qwe.tokens
The output was empty.
What do I wrong? Where that aliases are saved?
Assuming you have the grun alias set up (if not, see the QuickStart at the tops of this page https://www.antlr.org):
What you want is to view the token stream produced by the Lexer processing your input (not your
qwe.tokens
file)qwe.txt:
AS you can see... both
total_sales
andqwe
are recognized asCOLUMN
tokens,