[antlr-interest] No errors output by v4 daily build?
Terence Parr
parrt at cs.usfca.edu
Fri Jan 20 09:14:16 PST 2012
boy,That is very weird because I specifically added syntax checks for the missing ';' and so on. let me try one.
ok, yeah, I don't have the check in there that the filename is the same as the grammar name. here is one check for the missing ';'
~/antlr/code/antlr4/main/tool/playground $ cat XX.g
grammar E;
a : A
~/antlr/code/antlr4/main/tool/playground $ a4 XX.g
error(15): XX.g:4:0: mismatched input '<EOF>' expecting SEMI while matching a rule
and another
~/antlr/code/antlr4/main/tool/playground $ cat XX.g
grammar E;
a : A
b : B ;
~/antlr/code/antlr4/main/tool/playground $ a4 XX.g
error(15): XX.g:4:0: unterminated rule (missing ';') detected at 'b :' while looking for rule element
perhaps you should send me an example.
Ter
On Jan 20, 2012, at 8:54 AM, Peter Boughton wrote:
> Hi Terence,
>
>> what does "grammar has any errors" mean exactly?
>
> Well, simply that if there is anything wrong with the syntax/contents
> of the grammar file.
>
> For example, if I name the file "a.g" and the first line is "grammar
> b", or if I delete a semi-colon from the end of a rule, so it's not
> valid ANTLR syntax, or if I try to refer to a rule that doesn't exist
> yet, or have an unescaped apostrophe, and so on.
>
> The only way to tell if the grammar is ok is to check if the generated
> files exist and if the modified date is up-to-date. If it doesn't
> work, there's no easy way to know what the error is.
>
> Making sense now?
>
> Thanks,
>
> Peter
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
More information about the antlr-interest
mailing list