Commit 755f7466 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Can now parse an empty VacuumGripper description. Not much, but at least it...

Can now parse an empty VacuumGripper description. Not much, but at least it doesn't crash any longer
parent 209ded57
......@@ -12,11 +12,11 @@ aspect AbsGrammarGeneration {
public void Start.genAbsGrammar(PrintStream pStream) {
pStream.println("// Predefined types");
pStream.println("Start ::= Element;");
pStream.println("Start ::= ComplexElement;");
pStream.println("abstract Thing ::=;");
pStream.println("abstract Element;");
// pStream.println("ComplexElement ::= Attribute* Element*;");
pStream.println("ComplexElement ::= id1:OwlIdentifier id2:OwlIdentifier;");
pStream.println("ComplexElement ::= OwlIdentifier Attribute* Element*;");
// pStream.println("ComplexElement ::= id1:OwlIdentifier id2:OwlIdentifier;");
pStream.println("abstract SimpleElement : Element;");
pStream.println("StringElement : SimpleElement ::= <IDENTIFIER>;");
pStream.println("IntElement : SimpleElement ::= <INTEGER_LITERAL>;");
......
......@@ -6,9 +6,9 @@ options {
NODE_PREFIX = "";
JAVA_UNICODE_ESCAPE = true;
STATIC = false;
// DEBUG_PARSER = true;
// DEBUG_LOOKAHEAD = true;
// DEBUG_TOKEN_MANAGER = true;
DEBUG_PARSER = true;
DEBUG_LOOKAHEAD = true;
DEBUG_TOKEN_MANAGER = true;
} // options
......@@ -286,7 +286,7 @@ SPECIAL_TOKEN : /* COMMENTS */
Start Start() #Start : {}
{
("<?xml version=\"1.0\"?>")?
ComplexElement()
ComplexElement()
{ return jjtThis; }
}
// "<" Identifier() ">" "</" Identifier() ">"
......@@ -311,7 +311,7 @@ Start Start() #Start : {}
void ElementList() #List : {}
{
(Element())*
(ComplexElement())*
}
void AttributeList() #List : {}
......@@ -321,10 +321,10 @@ void AttributeList() #List : {}
void ComplexElement() #ComplexElement : {}
{
"<" Identifier() ">" "</" Identifier() ">"
"<" Identifier() AttributeList()
(">" ElementList() "</" <IDENTIFIER> ">" | ElementList() "/>")
}
// (">" ElementList() "</" <IDENTIFIER> ">" | ElementList() "/>")
// {jjtThis.setIDENTIFIER(t.image);}
// "<" Identifier() ">" "</" Identifier() ">"
void Identifier() #OwlIdentifier : {Token t;}
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment