-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello again everybody.
As I mentioned previously, I'm working on implementing the grammar for bash in
ANTLR w/ the output being an AST, and I've run into the following problem:
In bash, to define a variable, it has to be of the form:
name=value
There can be no spaces around the equals sign (bash is a bit strange about its
whitespace, which has caused me some fun headaches)
My question is this: if I have:
foo=bar
I'd like the resulting AST to be:
(= foo bar)
However, when I try to implement this as:
arr_var_def2
: NAME EQUALS^ NAME;
or anything similar where I try to define all the tokens at once, it doesn't
parse correctly, I believe because it's parsing "foo=bar" as one token.
However, if I do:
arr_var_def
: ARR_VAR_DEF;
ARR_VAR_DEF: NAME EQUALS NAME;
It parses correctly (since ARR_VAR_DEF is one token), but I cannot control the
AST output, and it just outputs it as the one token.
I know about http://antlr.markmail.org, but I'm not exactly sure what to search
for for this question.
Thank you so much for all the help you have given me thus far.
Nathan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
iEYEARECAAYFAkwNIfsACgkQFpoRlVgtqKZaMwCfTWY48VBh4I4AZReYMCCspxZX
NhYAoIEZ3uqxuD5S9o9fZjOrtwYp0PlW
=m4vZ
-----END PGP SIGNATURE-----
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.