[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Java parser throws ArrayIndexOutOfBoundsException if first token lea
From: |
Akim Demaille |
Subject: |
Re: Java parser throws ArrayIndexOutOfBoundsException if first token leads to syntax error |
Date: |
Thu, 23 Feb 2012 19:27:05 +0100 |
Le 23 févr. 2012 à 18:48, Tim Landscheidt a écrit :
> While the assignment form is somewhere over the ocean, I re-
> indented and -wrote the test case a bit to bring it more in
> line with the other code and added TABs to the commit mes-
> sage. Is this "ready-to-commit"?
Actually not everybody is using that style for the git logs,
and I am the one who should change his habits.
> Also on this topic: Are there useful Emacs tidbits and/or
> git hooks to format and check commit messages?
Have a look at vc-dwim. I am not using it, yet.
> +AT_DATA([[input1.txt]], [[--
> +]])
> +AT_DATA([[input2.txt]], [[-+
> +]])
> +AT_DATA([[input3.txt]], [[+-
> +]])
> +AT_BISON_CHECK([[YYParser.y]])
> +AT_JAVA_COMPILE([[YYParser.java]])
> +AT_JAVA_PARSER_CHECK([[YYParser < input1.txt]], [[0]], [[]], [[]])
> +AT_JAVA_PARSER_CHECK([[YYParser < input2.txt]], [[0]], [[]], [[syntax error
> +]])
> +AT_JAVA_PARSER_CHECK([[YYParser < input3.txt]], [[0]], [[]], [[syntax error
> +]])
I would prefer
AT_BISON_CHECK([[YYParser.y]])
AT_JAVA_COMPILE([[YYParser.java]])
AT_DATA(input.txt, …)
AT_JAVA_PARSER_CHECK(YYParser < input.txt)
AT_DATA(input.txt, …)
AT_JAVA_PARSER_CHECK(YYParser < input.txt)
AT_DATA(input.txt, …)
AT_JAVA_PARSER_CHECK(YYParser < input.txt)
Actually, I would even prefer not using stdin, but passing the
string as argv. And 'a', 'b' are more traditional than - and + :)
See for instance actions.at, snippets such as
AT_PARSER_CHECK([./input '(x)'], 0,
AT_PARSER_CHECK([./input '(xxxxx)(x)(x)y'], 1,
etc.