Collaboration diagram for Archon::X3D::VRML::Parser:
Public Member Functions | |
Parser () | |
Public Attributes | |
auto_ptr< Lexer::Actor< Context > > | lexerActor |
auto_ptr< Lexer::Engine > | lexerEngine |
auto_ptr< LrParserBase::Actor< Context > > | parserActor |
auto_ptr< Printer > | printer |
auto_ptr< SlrParser > | lrParser |
Classes | |
struct | Context |
struct | Printer |
Parsing VRML with an LR parser imposes a problem. The problem is the the type and structure of field values cannot be deduced by the syntax alone. That is, the canonical grammer is not context free. An example would be that when reading the input "0 0 0" it could be a vector with three components, or it couild be a zero size image. Consequently the grammar cannot help us build up the structure of the field valus.
One might be attempted to solve the problem with lexical tie-ins, and this would indeed be an attractive strategy, but such an attempt will fail due to the fact that there is no seperating token beween the field name that determines the type and the actual value. A seperating token is needed because the parser keeps a look-ahead token and thus has read the first token of the value when it performs the action associated with the field name.
Instead the grammar for field valus is reduced to a sequence of possible value components. It is then up to the semantical system to assemble the components into the proper structured values.
Definition at line 60 of file parse_vrml.C.