Funny bug. The grammar accepted any initial chunk of an active or static program as the whole thing, because it wasn't saying that the EOF had to come next!
This commit is contained in:
jdf
2010-03-15 20:01:12 +00:00
parent 8c821b1c4e
commit e96f1e5bd1
+5 -5
View File
@@ -46,10 +46,10 @@ pdeProgram
// imports (and they must have at least one)
: ( "public" "class" | "import" ) => javaProgram
{ pp.setProgramType(PdePreprocessor.ProgramType.JAVA); }
| ((statement)*) => staticProgram
{ pp.setProgramType(PdePreprocessor.ProgramType.STATIC); }
| activeProgram
| (activeProgram) => activeProgram
{ pp.setProgramType(PdePreprocessor.ProgramType.ACTIVE); }
| staticProgram
{ pp.setProgramType(PdePreprocessor.ProgramType.STATIC); }
;
@@ -59,11 +59,11 @@ javaProgram
;
activeProgram
: (possiblyEmptyField)+
: (possiblyEmptyField)+ EOF!
;
staticProgram
: (statement)*
: (statement)* EOF!
;
// copy of the java.g rule with WEBCOLOR_LITERAL added