Hi again,
I want to share my solution with you and the future generations
stumbling across similar problems ;) I decided implementing the exact
semicolon rules was not worth the trouble:
- The grammar is already quite complex and difficult to understand,
changing these to respect semicolon r
Your solution attempts to modify lexer state from the parser,
which ties you to what would, ideally, be the implementation-dependent
details of precisely when the parser invokes the lexer.
Also seems like your solution only catches one side of the issue,
if I've understood it correctly.
AFAIK, bis
Thank you for all your answers. The language I am trying to implement
is quite complex, unfortunately. It has various --and also optional--
block-like structures. Hence I personally would prefer setting the
context variable for the lexer, over rearranging the whole grammar just
for this nagging
I’m certainly no bison expert, but something like the following might be a
starting point:
start: semicolon_terminated_statements
;
semicolon_terminated_statements:
/* empty */
| semicolon_terminated_statements semicolon_terminated_statement
| semicolon_terminated_statements block
;
b
> On 15 Nov 2014, at 15:25, Matthias Simon wrote:
> I am struggling with some semicolon rules for some time now. In this language
> (TTCN3) statements end with an mandatory semicolon, except there is a curly
> bracket around. Example:
>
> // -8<-[SNIP!]
>{
>
Hi,
I am struggling with some semicolon rules for some time now. In this
language (TTCN3) statements end with an mandatory semicolon, except
there is a curly bracket around. Example:
// -8<-[SNIP!]
{
var integer a;
var integer b[2] := { 23, 5 }