[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Grammatica-users] Negation in production rules
From: |
Andrew Smellie |
Subject: |
[Grammatica-users] Negation in production rules |
Date: |
Mon, 3 May 2010 12:30:58 -0400 |
Hi
I have a very simple grammar that captures data of the form KEY=VALUE
I have written the rule to parse a KEY, but the complexity comes in parsing the
data. It can span multiple lines, be of arbitrary length and data type (int,
float, date, string). In fact the only thing you can really say about it is
that it is not a KEY.
I really want to say something like
KEY=(NOT A KEY)
and parse the three parts (KEY, EQUALS, NOT A KEY) accordingly.
How do I write a production rule that says "not a token"?
I have pasted some of the file below as an example:
DATE="Thu Apr 22 20:41:15 2010"
METHOD=AM1
TITLE="Untitled-1"
KEYWORDS=" AUX AM1 ALLVEC CHARGE=0 COSMO ESP ESR GRAPH HYPERFINE MULLIK POLAR
SHIFT=80 SPIN"
COMMENTS=""
ATOM_EL[0008]=
C C H H H H H H
ATOM_CORE[0008]=
4 4 1 1 1 1 1 1
ATOM_X:ANGSTROMS[0024]=
-0.3893 0.6545 0.0000
0.3893 -0.6545 0.0000
0.3150 1.5163 0.0000
-1.0344 0.7137 0.9050
-1.0344 0.7137 -0.9050
-0.3150 -1.5163 0.0000
1.0344 -0.7137 0.9050
1.0344 -0.7137 -0.9050
AO_ATOMINDEX[0014]=
1 1 1 1 2 2 2 2 3 4 5 6 7 8
ATOM_SYMTYPE[0014]=
S PX PY PZ S PX PY PZ S S S S S S
AO_ZETA[0014]=
1.8087 1.6851 1.6851 1.6851 1.8087 1.6851 1.6851 1.6851 1.1881 1.1881
1.1881 1.1881 1.1881 1.1881
ATOM_PQN[0014]=
2 2 2 2 2 2 2 2 1 1 1 1 1 1
- [Grammatica-users] Negation in production rules,
Andrew Smellie <=