Skip to content
Snippets Groups Projects
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
Branches
Tags
No related merge requests found
GrammarFile goal GrammarFile goal
= comment_list.c grammar_file.f {: f.getDeclarationList().insertChild(new EmptyDeclaration(c), 0); return f; :} = comment_list.c grammar_file.f {: f.getDeclarationList().insertChild(new EmptyDeclaration(c), 0); return f; :}
| grammar_file
; ;
GrammarFile grammar_file GrammarFile grammar_file
...@@ -16,8 +15,8 @@ Declaration declaration ...@@ -16,8 +15,8 @@ Declaration declaration
// this method would be create by the JAstAddParser from a usage of // this method would be create by the JAstAddParser from a usage of
// 'comment+' in a rule, but only for the standard list class 'List'. // 'comment+' in a rule, but only for the standard list class 'List'.
JastAddList comment_list JastAddList comment_list
= comment.n {: return new JastAddList().add(n); :} = comment.c comment_list.l {: l.insertChild(c, 0); return l; :}
| comment_list.l comment.n {: return l.add(n); :} | /* epsilon */ {: return new JastAddList(); :}
; ;
Comment comment Comment comment
......
<YYINITIAL,DECLARATION> { <YYINITIAL,COMMENT,DECLARATION> {
"abstract" { yybegin(DECLARATION); return sym(Terminals.ABSTRACT); } "abstract" { yybegin(DECLARATION); return sym(Terminals.ABSTRACT); }
"rel" { yybegin(DECLARATION); return sym(Terminals.RELATION); } "rel" { yybegin(DECLARATION); return sym(Terminals.RELATION); }
} }
<YYINITIAL,DECLARATION> { <YYINITIAL,COMMENT,DECLARATION> {
{ID} { yybegin(DECLARATION); return sym(Terminals.ID); } {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); } <<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(COMMENT); return sym(Terminals.SCOL); }
":" { yybegin(DECLARATION); return sym(Terminals.COL); } ":" { yybegin(DECLARATION); return sym(Terminals.COL); }
"::=" { yybegin(DECLARATION); return sym(Terminals.ASSIGN); } "::=" { 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment