--- trunk/src/mdParser/MDParser.g 2008/07/14 12:35:58 1277 +++ branches/development/src/mdParser/MDParser.g 2012/08/09 15:52:59 1776 @@ -28,6 +28,7 @@ tokens COMPONENT = "component"; MOLECULE = "molecule"; ZCONSTRAINT = "zconstraint"; + RESTRAINT = "restraint"; ATOM = "atom"; BOND = "bond"; BEND = "bend"; @@ -40,6 +41,9 @@ tokens CENTER = "center"; POSITION = "position"; ORIENTATION = "orientation"; + FLUCQ = "flucQ"; + RNEMD = "RNEMD"; + MINIMIZER = "minimizer"; ENDBLOCK; } @@ -48,16 +52,21 @@ statement : assignment ; statement : assignment - | componentblock - | moleculeblock - | zconstraintblock - ; - + | componentblock + | moleculeblock + | zconstraintblock + | restraintblock + | flucqblock + | rnemdblock + | minimizerblock + ; + assignment : ID ASSIGNEQUAL^ constant SEMICOLON! ; constant : intConst - | floatConst + | floatConst + | vectorConst | ID | StringLiteral ; @@ -67,6 +76,18 @@ zconstraintblock : ZCONSTRAINT^ LCURLY! (assignment)* zconstraintblock : ZCONSTRAINT^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);} ; + +restraintblock : RESTRAINT^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);} + ; + +flucqblock : FLUCQ^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);} + ; + +rnemdblock : RNEMD^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);} + ; + +minimizerblock : MINIMIZER^ LCURLY! (assignment)* RCURLY {#RCURLY->setType(ENDBLOCK);} + ; moleculeblock : MOLECULE^ LCURLY! (moleculestatement)* RCURLY {#RCURLY->setType(ENDBLOCK);} ; @@ -163,7 +184,11 @@ floatConst NUM_FLOAT | NUM_DOUBLE ; - +protected +vectorConst + : + LPAREN^ doubleNumber COMMA doubleNumber COMMA doubleNumber RPAREN + ; class MDLexer extends Lexer; @@ -267,7 +292,7 @@ LineDirective } ("line")? // this would be for if the directive started "#line" (Space)+ - n:Decimal { setLine(oopse::lexi_cast(n->getText()) - 1); } + n:Decimal { setLine(OpenMD::lexi_cast(n->getText()) - 1); } (Space)+ (sl:StringLiteral) {std::string filename = sl->getText().substr(1,sl->getText().length()-2); observer->notify(filename);} ((Space)+ Decimal)* // To support cpp flags (GNU)