diff --git a/.bzrignore b/.bzrignore index 67c0a9aac07867d11d9326636ef89dbba832dae0..03c15cc4c2bf2e58d876ad7ce7a8c5c02d2e2b19 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,2 +1,4 @@ parser/semantic.cache +AST +*.class diff --git a/Dumper.java b/Dumper.java new file mode 100644 index 0000000000000000000000000000000000000000..349c443081cd95b78eefc9e4ac4ad99d249d87dc --- /dev/null +++ b/Dumper.java @@ -0,0 +1,16 @@ +/* + * Created on 2005-mar-09 + * + */ +// package programs; + +import AST.Start; + +public class Dumper extends Parser { + public static void main(String args[]) { + Start ast = parse(args); + + // Dump the AST + ast.dumpTree(" ", System.out); + } +} \ No newline at end of file diff --git a/GripperOnotology.owl b/GripperOnotology.owl index 7e787ea10b7ad2f259e8e2f71924fd6b6c5ef0c7..305efef39fbf9a4286a5ad3e52de3291493f704c 100644 --- a/GripperOnotology.owl +++ b/GripperOnotology.owl @@ -1,180 +1,180 @@ <?xml version="1.0"?> -<rdf:RDF - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:xsd="http://www.w3.org/2001/XMLSchema#" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" - xmlns:owl="http://www.w3.org/2002/07/owl#" - xmlns="http://www.owl-ontologies.com/unnamed.owl#" - xml:base="http://www.owl-ontologies.com/unnamed.owl"> - <owl:Ontology rdf:about=""/> - <owl:Class rdf:ID="Skill"> - <owl:disjointWith> - <owl:Class rdf:ID="Gripper"/> - </owl:disjointWith> - </owl:Class> - <owl:Class rdf:ID="VacuumGripper"> - <rdfs:subClassOf> - <owl:Class rdf:about="#Gripper"/> - </rdfs:subClassOf> - <owl:disjointWith> - <owl:Class rdf:ID="PincerGripper"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:ID="MagnetGripper"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:ID="AdhesionGripper"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:ID="FingerGripper"/> - </owl:disjointWith> - </owl:Class> - <owl:Class rdf:ID="AngleGripper"> - <rdfs:subClassOf> - <owl:Class rdf:about="#PincerGripper"/> - </rdfs:subClassOf> - <owl:disjointWith> - <owl:Class rdf:ID="ParallelGripper"/> - </owl:disjointWith> - </owl:Class> - <owl:Class rdf:ID="CircularParallelGripper"> - <rdfs:subClassOf> - <owl:Class rdf:about="#ParallelGripper"/> - </rdfs:subClassOf> - <owl:disjointWith> - <owl:Class rdf:ID="GeneralParallelGripper"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:ID="LineParallelGripper"/> - </owl:disjointWith> - </owl:Class> - <owl:Class rdf:about="#PincerGripper"> - <owl:disjointWith> - <owl:Class rdf:about="#MagnetGripper"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:about="#AdhesionGripper"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:about="#FingerGripper"/> - </owl:disjointWith> - <owl:disjointWith rdf:resource="#VacuumGripper"/> - <rdfs:subClassOf> - <owl:Class rdf:about="#Gripper"/> - </rdfs:subClassOf> - </owl:Class> - <owl:Class rdf:about="#ParallelGripper"> - <rdfs:subClassOf rdf:resource="#PincerGripper"/> - <owl:disjointWith rdf:resource="#AngleGripper"/> - </owl:Class> - <owl:Class rdf:ID="ActuatorSkill"> - <rdfs:subClassOf rdf:resource="#Skill"/> - </owl:Class> - <owl:Class rdf:ID="GripperSkill"> - <rdfs:subClassOf rdf:resource="#ActuatorSkill"/> - </owl:Class> - <owl:Class rdf:about="#FingerGripper"> - <rdfs:subClassOf> - <owl:Class rdf:about="#Gripper"/> - </rdfs:subClassOf> - <owl:disjointWith rdf:resource="#PincerGripper"/> - <owl:disjointWith rdf:resource="#VacuumGripper"/> - <owl:disjointWith> - <owl:Class rdf:about="#MagnetGripper"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:about="#AdhesionGripper"/> - </owl:disjointWith> - </owl:Class> - <owl:Class rdf:ID="ElasticGripper"> - <owl:disjointWith> - <owl:Class rdf:ID="JointGripper"/> - </owl:disjointWith> - <rdfs:subClassOf rdf:resource="#FingerGripper"/> - </owl:Class> - <owl:Class rdf:ID="Open"> - <owl:disjointWith> - <owl:Class rdf:ID="Close"/> - </owl:disjointWith> - <owl:disjointWith> - <owl:Class rdf:ID="DetectHolding"/> - </owl:disjointWith> - <rdfs:subClassOf rdf:resource="#GripperSkill"/> - </owl:Class> - <owl:Class rdf:about="#LineParallelGripper"> - <owl:disjointWith rdf:resource="#CircularParallelGripper"/> - <owl:disjointWith> - <owl:Class rdf:about="#GeneralParallelGripper"/> - </owl:disjointWith> - <rdfs:subClassOf rdf:resource="#ParallelGripper"/> - </owl:Class> - <owl:Class rdf:ID="Device"> - <rdfs:subClassOf> - <owl:Restriction> - <owl:onProperty> - <owl:ObjectProperty rdf:ID="hasSkill"/> - </owl:onProperty> - <owl:someValuesFrom rdf:resource="#Skill"/> - </owl:Restriction> - </rdfs:subClassOf> - <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> - </owl:Class> - <owl:Class rdf:about="#AdhesionGripper"> - <owl:disjointWith rdf:resource="#FingerGripper"/> - <rdfs:subClassOf> - <owl:Class rdf:about="#Gripper"/> - </rdfs:subClassOf> - <owl:disjointWith> - <owl:Class rdf:about="#MagnetGripper"/> - </owl:disjointWith> - <owl:disjointWith rdf:resource="#PincerGripper"/> - <owl:disjointWith rdf:resource="#VacuumGripper"/> - </owl:Class> - <owl:Class rdf:about="#GeneralParallelGripper"> - <rdfs:subClassOf rdf:resource="#ParallelGripper"/> - <owl:disjointWith rdf:resource="#LineParallelGripper"/> - <owl:disjointWith rdf:resource="#CircularParallelGripper"/> - </owl:Class> - <owl:Class rdf:about="#MagnetGripper"> - <owl:disjointWith rdf:resource="#AdhesionGripper"/> - <owl:disjointWith rdf:resource="#PincerGripper"/> - <owl:disjointWith rdf:resource="#FingerGripper"/> - <owl:disjointWith rdf:resource="#VacuumGripper"/> - <rdfs:subClassOf> - <owl:Class rdf:about="#Gripper"/> - </rdfs:subClassOf> - </owl:Class> - <owl:Class rdf:about="#JointGripper"> - <rdfs:subClassOf rdf:resource="#FingerGripper"/> - <owl:disjointWith rdf:resource="#ElasticGripper"/> - </owl:Class> - <owl:Class rdf:about="#DetectHolding"> - <owl:disjointWith rdf:resource="#Open"/> - <rdfs:subClassOf rdf:resource="#GripperSkill"/> - <owl:disjointWith> - <owl:Class rdf:about="#Close"/> - </owl:disjointWith> - </owl:Class> - <owl:Class rdf:about="#Gripper"> - <owl:equivalentClass> - <owl:Restriction> - <owl:onProperty> - <owl:ObjectProperty rdf:about="#hasSkill"/> - </owl:onProperty> - <owl:allValuesFrom rdf:resource="#GripperSkill"/> - </owl:Restriction> - </owl:equivalentClass> - <owl:disjointWith rdf:resource="#Skill"/> - <rdfs:subClassOf rdf:resource="#Device"/> - </owl:Class> - <owl:Class rdf:about="#Close"> - <owl:disjointWith rdf:resource="#DetectHolding"/> - <owl:disjointWith rdf:resource="#Open"/> - <rdfs:subClassOf rdf:resource="#GripperSkill"/> - </owl:Class> - <owl:ObjectProperty rdf:about="#hasSkill"> - <rdfs:domain rdf:resource="#Device"/> - </owl:ObjectProperty> -</rdf:RDF> +<!-- <rdf:RDF --> +<!-- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" --> +<!-- xmlns:xsd="http://www.w3.org/2001/XMLSchema#" --> +<!-- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" --> +<!-- xmlns:owl="http://www.w3.org/2002/07/owl#" --> +<!-- xmlns="http://www.owl-ontologies.com/unnamed.owl#" --> +<!-- xml:base="http://www.owl-ontologies.com/unnamed.owl"> --> +<!-- <owl:Ontology rdf:about=""/> --> +<!-- <owl:Class rdf:ID="Skill"> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="Gripper"/> --> +<!-- </owl:disjointWith> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="VacuumGripper"> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Class rdf:about="#Gripper"/> --> +<!-- </rdfs:subClassOf> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="PincerGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="MagnetGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="AdhesionGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="FingerGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="AngleGripper"> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Class rdf:about="#PincerGripper"/> --> +<!-- </rdfs:subClassOf> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="ParallelGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="CircularParallelGripper"> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Class rdf:about="#ParallelGripper"/> --> +<!-- </rdfs:subClassOf> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="GeneralParallelGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="LineParallelGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#PincerGripper"> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#MagnetGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#AdhesionGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#FingerGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith rdf:resource="#VacuumGripper"/> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Class rdf:about="#Gripper"/> --> +<!-- </rdfs:subClassOf> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#ParallelGripper"> --> +<!-- <rdfs:subClassOf rdf:resource="#PincerGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#AngleGripper"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="ActuatorSkill"> --> +<!-- <rdfs:subClassOf rdf:resource="#Skill"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="GripperSkill"> --> +<!-- <rdfs:subClassOf rdf:resource="#ActuatorSkill"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#FingerGripper"> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Class rdf:about="#Gripper"/> --> +<!-- </rdfs:subClassOf> --> +<!-- <owl:disjointWith rdf:resource="#PincerGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#VacuumGripper"/> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#MagnetGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#AdhesionGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="ElasticGripper"> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="JointGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <rdfs:subClassOf rdf:resource="#FingerGripper"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="Open"> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="Close"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:ID="DetectHolding"/> --> +<!-- </owl:disjointWith> --> +<!-- <rdfs:subClassOf rdf:resource="#GripperSkill"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#LineParallelGripper"> --> +<!-- <owl:disjointWith rdf:resource="#CircularParallelGripper"/> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#GeneralParallelGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <rdfs:subClassOf rdf:resource="#ParallelGripper"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:ID="Device"> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Restriction> --> +<!-- <owl:onProperty> --> +<!-- <owl:ObjectProperty rdf:ID="hasSkill"/> --> +<!-- </owl:onProperty> --> +<!-- <owl:someValuesFrom rdf:resource="#Skill"/> --> +<!-- </owl:Restriction> --> +<!-- </rdfs:subClassOf> --> +<!-- <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#AdhesionGripper"> --> +<!-- <owl:disjointWith rdf:resource="#FingerGripper"/> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Class rdf:about="#Gripper"/> --> +<!-- </rdfs:subClassOf> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#MagnetGripper"/> --> +<!-- </owl:disjointWith> --> +<!-- <owl:disjointWith rdf:resource="#PincerGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#VacuumGripper"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#GeneralParallelGripper"> --> +<!-- <rdfs:subClassOf rdf:resource="#ParallelGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#LineParallelGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#CircularParallelGripper"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#MagnetGripper"> --> +<!-- <owl:disjointWith rdf:resource="#AdhesionGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#PincerGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#FingerGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#VacuumGripper"/> --> +<!-- <rdfs:subClassOf> --> +<!-- <owl:Class rdf:about="#Gripper"/> --> +<!-- </rdfs:subClassOf> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#JointGripper"> --> +<!-- <rdfs:subClassOf rdf:resource="#FingerGripper"/> --> +<!-- <owl:disjointWith rdf:resource="#ElasticGripper"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#DetectHolding"> --> +<!-- <owl:disjointWith rdf:resource="#Open"/> --> +<!-- <rdfs:subClassOf rdf:resource="#GripperSkill"/> --> +<!-- <owl:disjointWith> --> +<!-- <owl:Class rdf:about="#Close"/> --> +<!-- </owl:disjointWith> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#Gripper"> --> +<!-- <owl:equivalentClass> --> +<!-- <owl:Restriction> --> +<!-- <owl:onProperty> --> +<!-- <owl:ObjectProperty rdf:about="#hasSkill"/> --> +<!-- </owl:onProperty> --> +<!-- <owl:allValuesFrom rdf:resource="#GripperSkill"/> --> +<!-- </owl:Restriction> --> +<!-- </owl:equivalentClass> --> +<!-- <owl:disjointWith rdf:resource="#Skill"/> --> +<!-- <rdfs:subClassOf rdf:resource="#Device"/> --> +<!-- </owl:Class> --> +<!-- <owl:Class rdf:about="#Close"> --> +<!-- <owl:disjointWith rdf:resource="#DetectHolding"/> --> +<!-- <owl:disjointWith rdf:resource="#Open"/> --> +<!-- <rdfs:subClassOf rdf:resource="#GripperSkill"/> --> +<!-- </owl:Class> --> +<!-- <owl:ObjectProperty rdf:about="#hasSkill"> --> +<!-- <rdfs:domain rdf:resource="#Device"/> --> +<!-- </owl:ObjectProperty> --> +<!-- </rdf:RDF> --> <!-- Created with Protege (with OWL Plugin 2.1, Build 284) http://protege.stanford.edu --> diff --git a/Parser.java b/Parser.java new file mode 100644 index 0000000000000000000000000000000000000000..2ded572c4ef6917aff6c83b38cde94efb86c5809 --- /dev/null +++ b/Parser.java @@ -0,0 +1,50 @@ +/* + * Created on 2005-mar-10 + * + */ +// package programs; + +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.InputStreamReader; +import java.io.Reader; + +import AST.OwlParser; +import AST.ParseException; +import AST.Start; + +/** + * @author gorel + * + */ +public class Parser { + + protected static Start parse(String args[]) { + Reader r = getReader(args); + Start ast = null; + try { + OwlParser parser = new OwlParser(r); + + // Start parsing from the nonterminal "Start". + ast = parser.Start(); + } catch (ParseException e) { + System.out.println(e.getMessage()); + } + return ast; + } + + private static Reader getReader(String[] args) { + Reader r = null; + if (args.length != 1) { + r = new InputStreamReader(System.in); + } else { + try { + r = new FileReader(args[0]); + } catch (FileNotFoundException e1) { + System.err.println("Dumper: file " + args[0] + " not found"); + } + } + return r; + } + +} \ No newline at end of file diff --git a/build.xml b/build.xml index 7d9c1d65d9ae9bb11581d936e12348d74d171f15..8b773ac8a8b2d748716886a535ccd38f00fedc5e 100644 --- a/build.xml +++ b/build.xml @@ -16,6 +16,8 @@ <property name="javacc.home" value="tools/javacc-4.0"/> + <property name="parser.name" value="OwlParser"/> + <!-- "jflex" is an ant task class for the scanner generator in JFlex.jar --> <!-- <taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="tools/JFlex.jar"/> --> <!-- "beaver" is an ant task class for the parser generator in beaver.jar --> @@ -25,7 +27,7 @@ <!-- compile sources --> <target name="build" depends="gen"> - <javac compiler="jikes" debug="true" nowarn="true" srcdir="." includes="**/*.java" excludes="test/**" classpath=".:${tools}/beaver-rt.jar:${tools}/junit.jar"/> + <javac compiler="jikes" debug="true" nowarn="true" srcdir="." includes="**/*.java" excludes="tools/**" classpath=".:${tools}/beaver-rt.jar:${tools}/junit.jar"/> </target> <!-- generate compiler source files --> @@ -33,15 +35,33 @@ <!-- create AST node types and weave aspect modules --> <echo message = "Running JastAdd"/> <!-- <jastadd package="${package}" rewrite="true" beaver="true" novisitcheck="true"> --> - <jastadd package="${package}" rewrite="true" beaver="false" novisitcheck="true"> + <jastadd package="${package}" grammar="${parser.name}" rewrite="true" jjtree="true"> <fileset dir="."> <include name="**/*.ast"/> <include name="**/*.jrag"/> <include name="**/*.jadd"/> </fileset> </jastadd> - <jjtree target="owl.jjt" outputdirectory="${package}" javacchome="${javacc.home}"/> - <javacc target="${package}/owl.jj" outputdirectory="${package}" javacchome="${javacc.home}"/> + <jjtree + target="owl.jjt" + outputdirectory="${package}" + javacchome="${javacc.home}" + buildnodefiles="true" + static="false" + multi="true" + visitor="true" + nodedefaultvoid="true" + nodeprefix='""' + nodepackage="${package}" + /> + <javacc + target="${package}/owl.jj" + outputdirectory="${package}" + javacchome="${javacc.home}" + buildparser="true" + buildtokenmanager="true" + static="false" + /> <!-- generate the scanner --> <!-- <echo message = "Running jflex"/> --> diff --git a/owl.ast b/owl.ast new file mode 100644 index 0000000000000000000000000000000000000000..46a303369ee26291dcbe6526cc9dc5eb176aae78 --- /dev/null +++ b/owl.ast @@ -0,0 +1,9 @@ +// -*-Java-*- +Start ::= Specification; + +Specification ::= Attribute*; + +Attribute ::= Id Value; + +Id ::= <IDENTIFIER>; +Value ::= <STRING_LITERAL>; \ No newline at end of file diff --git a/owl.jjt b/owl.jjt index cecbf1a1cfde6149f7ae743d624a21f0ae8396a8..fb4f0f568acb3a14cba4c667cabe7c63ed17d2bb 100644 --- a/owl.jjt +++ b/owl.jjt @@ -3,6 +3,7 @@ options { VISITOR = true; NODE_DEFAULT_VOID = true; NODE_SCOPE_HOOK = false; + NODE_PREFIX = ""; JAVA_UNICODE_ESCAPE = true; STATIC = false; } // options @@ -192,9 +193,9 @@ SPECIAL_TOKEN : /* COMMENTS */ }// SEPARATORS -// <DEFAULT,BOUNDS> TOKEN : /* OPERATORS */ -// { -// < ASSIGN : "=" > +<DEFAULT,BOUNDS> TOKEN : /* OPERATORS */ +{ + < ASSIGN : "=" > // | < GT : ">" > // | < LT : "<" > // | < BANG : "!" > @@ -231,16 +232,42 @@ SPECIAL_TOKEN : /* COMMENTS */ // | < LSHIFTASSIGN : "<<=" > // | < RSIGNEDSHIFTASSIGN : ">>=" > // | < RUNSIGNEDSHIFTASSIGN : ">>>=" > -// }// OPERATORS +}// OPERATORS //--------------------------------------------------------------------// // THE OWL LANGUAGE GRAMMAR // //--------------------------------------------------------------------// -Specification Specification() #Specification : {} +Start Start() #Start : {} { - "<?" <XML> AttributeList() "?>" + Specification() { return jjtThis; } } +void Specification() #Specification : {} +{ + "<?" <XML> AttributeList() "?>" +} + +void AttributeList() #List : {} +{ + (Attribute())* +} + +void Attribute() #Attribute : { Token t; } +{ + Id() <ASSIGN> Value() +} + +void Id() #Id : { Token t; } +{ + t = <IDENTIFIER> + {jjtThis.setIDENTIFIER(t.image);} +} + +void Value() #Value : { Token t; } +{ + t = <STRING_LITERAL> + {jjtThis.setSTRING_LITERAL(t.image);} +} \ No newline at end of file