[x3d-public] General-purpose VRML parsing motivations; Comparison of parser generators - Wikipedia
Don Brutzman
brutzman at nps.edu
Wed Aug 23 10:09:08 PDT 2017
The working group has been talking about possible ways to take advantage of the formal grammars for VRML syntax:
19776-2 Extensible 3D (X3D) encodings Part 2: Classic VRML encoding
Annex A (normative) Grammar
http://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/grammar.html
14772 Virtual Reality Modeling Language (VRML97)
Annex A (normative) Grammar definition
http://www.web3d.org/documents/specifications/14772/V2.0/part1/grammar.html
It would be interesting to generate a state-machine diagram for parsing the VRML grammar. Perhaps one already exists somewhere?
There are of course many converters and parsing libraries for VRML/X3D. Many open-source code APIs exist, though they tend to be specifically tied to implementation goals (such as rendering in a player).
X3D Resources: Conversions and Translation Tools
http://www.web3d.org/x3d/content/examples/X3dResources.html#Conversions
Am hoping that is we can create a simple VRML -> X3D importer, we might include it in various X3D SAI open-source implementations (like X3DJSONLD and X3DJSAIL). If it is simple code/pseudocode, then it would be straightforward to maintain across each of these programming languages: JavaScript, Java, C, C++, C#, Python, and others (e.g. ObjectPascal).
X3D Specification Relationships (draft)
http://2014.web3d.org/specifications/X3dSpecificationRelationships.2017August11.png
Wikipedia has an interesting page comparing grammar parsers:
https://en.wikipedia.org/wiki/Comparison_of_parser_generators
Perhaps ANTLR might be useful for parsing the VRML grammar and generating parsers? Multilingual support is provided.
Language-lawyer point: the grammar is not context free because of prototype instances... nevertheless if the XML pattern of ProtoInstance is adapted, a context-free grammar (CFG) for VRML is likely possible.
Round-trip testing will be quite possible using the X3D Example Archives as unit tests.
X3D Resources, Example Scene Archives for X3D
http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
Interesting possibilities! Onward we go.
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
More information about the x3d-public
mailing list