Hi, I'm having trouble writing a lexical analyzer.
I'm using the bovine parser generator, and my language grammar is given below. However, it's not really working on a trivial example file, despite my attempt to follow some of the example language grammars and doco.
Here is the simple test file:
If I call semantic-lex on this, I get the following results:
((symbol 1 . 23) (semantic-list 23 . 36))
I would have expected a punctuation or an open-parens lexical token in there somewhere, or am I mistaken? Either way, it seems that the lack of an open-paren token is causing the parser to fail on the command rule.
The language syntax table is correct, at least to the extent that ( is mapped to the open parenthesis syntax class.
Any help or pointers appreciated.
%token INCLUDE "include"
%token <open-paren> LPAREN "("
%token <close-paren> RPAREN ")"
CMakeLists : command
command : symbol LPAREN args RPAREN
args : arg some-whitespace args
| ;; empty
arg : symbol
some-whitespace : whitespace some-whitespace (nil)
| whitespace (nil)