ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/mdParser/MDParser.g
(Generate patch)

Comparing:
trunk/src/mdParser/MDParser.g (file contents), Revision 814 by tim, Fri Dec 16 02:57:00 2005 UTC vs.
branches/development/src/mdParser/MDParser.g (file contents), Revision 1776 by gezelter, Thu Aug 9 15:52:59 2012 UTC

# Line 28 | Line 28 | tokens
28    COMPONENT   = "component";
29    MOLECULE    = "molecule";
30    ZCONSTRAINT = "zconstraint";
31 +  RESTRAINT   = "restraint";
32    ATOM        = "atom";
33    BOND        = "bond";
34    BEND        = "bend";
35    TORSION     = "torsion";
36 +  INVERSION   = "inversion";
37    RIGIDBODY   = "rigidBody";
38    CUTOFFGROUP = "cutoffGroup";
39    FRAGMENT    = "fragment";
40    MEMBERS     = "members";
41 +  CENTER      = "center";
42    POSITION    = "position";
43    ORIENTATION = "orientation";
44 +  FLUCQ       = "flucQ";
45 +  RNEMD       = "RNEMD";
46 +  MINIMIZER   = "minimizer";
47    ENDBLOCK;
48   }
49  
# Line 46 | Line 52 | statement : assignment
52          ;
53  
54   statement : assignment
55 <          | componentblock
56 <          | moleculeblock
57 <          | zconstraintblock
58 <          ;
59 <            
55 >    | componentblock
56 >    | moleculeblock
57 >    | zconstraintblock
58 >    | restraintblock
59 >    | flucqblock
60 >    | rnemdblock
61 >    | minimizerblock
62 >    ;
63 >
64   assignment  : ID ASSIGNEQUAL^ constant SEMICOLON!
65              ;
66              
67   constant    : intConst
68 <                                                | floatConst
68 >                        | floatConst
69 >            | vectorConst
70              | ID
71              | StringLiteral
72              ;
# Line 65 | Line 76 | zconstraintblock  : ZCONSTRAINT^ LCURLY! (assignment)*
76      
77   zconstraintblock  : ZCONSTRAINT^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);}
78                    ;
79 +
80 + restraintblock  : RESTRAINT^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);}
81 +                  ;
82 +
83 + flucqblock  : FLUCQ^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);}
84 +    ;
85 +
86 + rnemdblock  : RNEMD^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);}
87 +    ;
88 +
89 + minimizerblock  : MINIMIZER^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);}
90 +    ;
91    
92   moleculeblock : MOLECULE^ LCURLY! (moleculestatement)*  RCURLY {#RCURLY->setType(ENDBLOCK);}
93                ;
# Line 74 | Line 97 | moleculestatement : assignment
97                    | bondblock
98                    | bendblock
99                    | torsionblock
100 +                  | inversionblock
101                    | rigidbodyblock
102                    | cutoffgroupblock
103                    | fragmentblock
# Line 107 | Line 131 | torsionstatement  : assignment
131  
132   torsionstatement  : assignment
133                | MEMBERS^ LPAREN! inttuple RPAREN! SEMICOLON!
134 +              ;
135 +
136 + inversionblock  : INVERSION^ (LBRACKET! intConst! RBRACKET!)?  LCURLY!(inversionstatement)* RCURLY {#RCURLY->setType(ENDBLOCK);}
137 +          ;
138 +
139 + inversionstatement  : assignment
140 +              | CENTER^ LPAREN! intConst RPAREN! SEMICOLON!
141                ;
142  
143   rigidbodyblock  : RIGIDBODY^  LBRACKET! intConst RBRACKET! LCURLY!(rigidbodystatement)* RCURLY {#RCURLY->setType(ENDBLOCK);}
# Line 153 | Line 184 | floatConst
184            NUM_FLOAT | NUM_DOUBLE
185          ;
186  
187 <
187 > protected
188 > vectorConst
189 >    :
190 >        LPAREN^ doubleNumber COMMA doubleNumber COMMA doubleNumber RPAREN
191 >    ;
192  
193   class MDLexer extends Lexer;
194  
# Line 257 | Line 292 | LineDirective
292    }
293      ("line")?  // this would be for if the directive started "#line"
294      (Space)+
295 <    n:Decimal { setLine(oopse::lexi_cast<int>(n->getText()) - 1); }
295 >    n:Decimal { setLine(OpenMD::lexi_cast<int>(n->getText()) - 1); }
296      (Space)+
297      (sl:StringLiteral) {std::string filename = sl->getText().substr(1,sl->getText().length()-2); observer->notify(filename);}
298      ((Space)+ Decimal)* // To support cpp flags (GNU)
# Line 457 | Line 492 | EXPONENT
492   // a couple protected methods to assist in matching floating point numbers
493   protected
494   EXPONENT
495 <        :       ('e'|'E') ('+'|'-')? ('0'..'9')+
495 >        :       ('e'|'E'|'d'|'D') ('+'|'-')? ('0'..'9')+
496          ;
497  
498   protected

Comparing:
trunk/src/mdParser/MDParser.g (property svn:keywords), Revision 814 by tim, Fri Dec 16 02:57:00 2005 UTC vs.
branches/development/src/mdParser/MDParser.g (property svn:keywords), Revision 1776 by gezelter, Thu Aug 9 15:52:59 2012 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines