.....DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++Comments++++++++++++
Definition of Standalone Field
Positions
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
... RPGLE grammar... eclipse plugin?
... don't ... need to transform it in to XML...
grammar Rpg;
sourceMember : (statement)* ;
statement : (procedure | assignment) ';' ;
assignment : (QUALIFIED|SYMNAME) (ASSIGNOP|'=') expr ;
expr : '(' expr ')'
| (bif | procedure)
| (NOT|PLUS|MINUS) expr
|<assoc=right> expr EXP expr
| expr MULT expr
| expr DIV expr
| expr PLUS expr
| expr MINUS expr
| expr (COMPARISON|'=') expr
| expr AND expr
| expr OR expr
| (LITERAL|QUALIFIED|SYMNAME)
;
bif : '%' SYMNAME '(' params? ')' ;
procedure : SYMNAME '(' params? ')' ;
params : expr (':' expr)* ;
// Margin and date area
DATEAREA : DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT
DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT
.? .? .? .? .? -> channel(HIDDEN)
/* {
if (getCharPositionInLine() != 0)
{ setType(INT); setChannel(DEFAULT_TOKEN_CHANNEL); }
} -> channel(HIDDEN) */
;
// Language constructs
IF : 'IF' ;
ELSE : 'ELSE';
ELSEIF : 'ELSEIF';
SELECT : 'SELECT' ;
WHEN : 'WHEN' ;
DOW : 'DOW' ;
DOU : 'DOU' ;
FOR : 'FOR' ;
AND : 'AND';
OR : 'OR';
COMMENT: '//' ~[\r\n]* -> channel(HIDDEN) ;
// Operators
NOT : 'NOT' ;
PLUS : '+' ;
MINUS : '-' ;
EXP : '**' ;
MULT : '*' ;
DIV : '/' ;
COMPARISON : GT
| LT
| GE
| LE
| NE
;
GT : '>' ;
LT : '<' ;
GE : '>=' ;
LE : '<=' ;
NE : '<>' ;
ASSIGNOP : CPLUS
| CMINUS
| CMULT
| CDIV
;
CPLUS : '+=' ;
CMINUS : '-=' ;
CMULT : '*=' ;
CDIV : '/=' ;
// Literals
LITERAL : DEC
| INT
| STRING
| SYMBOL
;
DEC : INT '.' INT ;
INT : DIGIT+
;
STRING : '\'' (~[\'\r\n]|'\'\'')* '\'' ;
SYMBOL : '*BLANK' 'S'?
| '*ZERO' 'S'?
| '*HIVAL'
| '*LOVAL'
| '*NULL'
| '*ON'
| '*OFF'
| '*ALL' STRING
;
// Symbol
QUALIFIED : SYMNAME '.' SYMNAME ;
SYMNAME : [A-Z$#@]+ [A-Z0-9_]*
// Whitespace
WS : [ \t\r\n] -> channel(HIDDEN);
fragment DIGIT : [0-9] ;
123123123123 A += (4 + +3) ** 2 ** 3 > (3 = 2 < -1.5) <> 1 123123123123 OR NOT B(NOT %A(B : 2) : 'babr''' : 4 > 2) AND B >= 3;123123123123 A = NOT B.C = *BLANK;123123123123 F();
...
Hi All,
I’m not sure about what is happening.
1. I’ve installed Antlr4 via NuGet on a VS2010 project (Install-Package Antlr4 -Version 4.3.0)
2. Added a combined grammar on the project (.g4) with the default contents, that has it Build Action setted to “Antlr4”
It doesn’t create the parser or the lexer class, anything I’ve tried to do…
What am I missing here?
TIA,
Nilo - Brazil
Hi Nilo,
If you aren’t getting an error when you build, then it’s generating the classes in the intermediate output directory (default obj/Debug for debug builds, and obj/Release for release builds).
If this doesn’t resolve you question, can you post some more details in a new issue?
https://github.com/tunnelvisionlabs/antlr4cs/issues
Thank you,
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi, Sam.
Thanks for answering.
You are right. It’s generating the classes on obj/Debug directory. Also, it’s generating Grammar.g4.parser.cs and Grammar.g4.lexer.cs.
I think I need some more studying on this…
Thanks again.
Nilo – Brazil
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5646 / Virus Database: 4299/9184 - Release Date: 02/26/15
Coolsbeans, we have a mini coding army assembled.
Greating a Parser for the new FRPGLE (Free RPG for ILE) should be a straightforward task as there are no positional considerations.
My issue is with parsing the fixed format. I have not been able to wrap my head around it.
I have been waiting for Ryan's method of Fixed Format Parsing.
Please Ryan don't keep us in suspense.
Share your code with us.
Regards,
Christoff
--
You received this message because you are subscribed to a topic in the Google Groups "antlr-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/antlr-discussion/shs4scLGUh0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to antlr-discussi...@googlegroups.com.