120 likes | 247 Views
The Amazing Group 13 Parser Generator. Jon Schmid Matthew Tong Justin Ward. Quick bit of honesty before the sale’s pitch. Currently use a slow version of a scanner. Quick bit of honesty before the sale’s pitch. However, supposedly a fix to the scanner is quick and easy
E N D
The Amazing Group 13 Parser Generator Jon Schmid Matthew Tong Justin Ward
Quick bit of honesty before the sale’s pitch • Currently use a slow version of a scanner
Quick bit of honesty before the sale’s pitch • However, supposedly a fix to the scanner is quick and easy • Our features are nifty
Nifty Features • Allows the document to have mandatory or default values for attributes • Attribute values are typed
Attribute Value Typing • The values of attributes are stored in the tree as Objects of a specific type, being validated in the process • Defaults to STRING • Ex. <attribute name=“number” type=“INT”> will store the value of “number” as an Integer for retrieval as an integer
More Nifty Features • Our DTD format eliminates any possible ambiguity in the parse tree • Allows for multiple “chunks” of CDATA • Example: <A> blah blah <B/> more words </A> will produce the following: <A> CDATA: blah blah CDATA: More words <B>
And wait, there’s more… • Can easily be modified to have the returned parse tree validate future additions and modifications to the tree, rumored to be needed in the coming project • Completely “Java Doc”ed • Implements union
Union • Allows multiple versions of each type of tag • Normal syntax: <element_type name=“A”> <element name=“element1”> … </element_type>
Union • Example of multi-versioned type: A single C and D, or any number of D’s: <element_type name=“B”> <version> <element name=“C”> <element name=“D”> </version <version> <element name =“D” number=“*”> </version> </element_type>
Union • Nested tags can be any one of the versions • The Verifier system will keep track of the conditions of each version and eliminate a version when it becomes invalid • Example: On seeing a nested <D>, both versions would still be valid, but upon getting another <D> or a <C>, one version would be eliminated. • The documents themselves don’t even show that any multi-versioning is occurring: <B> <D/> <C/> </B>