As I recall, yacc's default token is the ASCII value of a character.  The
lexer in this case needn't be more complicated, therefore, than getchar.
The rule in question means "An `a' is expected here."  Were there a `b' in
the input, and none of the other paths through the rules matched, the
program reports syntax error.  A little shell scripting to count the syntax
errors, a bit of subtraction, is the tally of matching strings.

I hope that some part of this answer is satisfactory.  May 2021 be better,
much, than 2020.

|Raul Miller rauldmiller at gmail.com
|Thu Dec 31 15:16:52 UTC 2020
|
|what is the significance of this line:
|
|a4: 'a' ;
|
|?
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to