Commit 192e92cf authored by Johannes Mey's avatar Johannes Mey
Browse files

Merge branch 'bugfix/missing-newline-parse-error' into 'develop'

Bugfix/missing newline parse error

See merge request jastadd/relast-preprocessor!4
parents 53052199 4bada54d
GrammarFile goal
= comment_list.c grammar_file.f {: f.getDeclarationList().insertChild(new EmptyDeclaration(c), 0); return f; :}
| grammar_file
;
GrammarFile grammar_file
......@@ -16,8 +15,8 @@ Declaration declaration
// this method would be create by the JAstAddParser from a usage of
// 'comment+' in a rule, but only for the standard list class 'List'.
JastAddList comment_list
= comment.n {: return new JastAddList().add(n); :}
| comment_list.l comment.n {: return l.add(n); :}
= comment.c comment_list.l {: l.insertChild(c, 0); return l; :}
| /* epsilon */ {: return new JastAddList(); :}
;
Comment comment
......
<YYINITIAL,DECLARATION> {
<YYINITIAL,COMMENT,DECLARATION> {
"abstract" { yybegin(DECLARATION); return sym(Terminals.ABSTRACT); }
"rel" { yybegin(DECLARATION); return sym(Terminals.RELATION); }
}
<YYINITIAL,DECLARATION> {
<YYINITIAL,COMMENT,DECLARATION> {
{ID} { yybegin(DECLARATION); return sym(Terminals.ID); }
[^] { throw new ScannerError((yyline+1) +"," + (yycolumn+1) + ": Illegal character <"+yytext()+">"); }
}
<YYINITIAL,DECLARATION,COMMENT> {
<YYINITIAL,COMMENT,DECLARATION> {
<<EOF>> { return sym(Terminals.EOF); }
}
[^] { throw new ScannerError((yyline+1) +"," + (yycolumn+1) + ": Illegal character <"+yytext()+">"); }
}
\ No newline at end of file
<YYINITIAL,DECLARATION> {
<YYINITIAL,COMMENT,DECLARATION> {
";" { yybegin(COMMENT); return sym(Terminals.SCOL); }
":" { yybegin(DECLARATION); return sym(Terminals.COL); }
"::=" { yybegin(DECLARATION); return sym(Terminals.ASSIGN); }
......
- name: "No whitespace/comment between and after rules required"
args:
- "--inputBaseDir=in"
- "--outputBaseDir=out"
- "Grammar.relast"
- "Relation.relast"
out: "out"
expected: "in"
compare: true
Person ::= <FullName> <Address> Gender;abstract Gender;
Male : Gender;Female : Gender;Diverse : Gender;
\ No newline at end of file
rel Person.Friend -> Person;rel Person.Child <-> Person.Parent;
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment