1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
SemVal
|
+-------+---------+
| |
StateData |
| |
StateString |
| |
State |
| |
+--------------------------------+ |
| | |
| States |
| | |
| +-------------------------+ +---------+
| | | | |
| | | | TextVal
| | | | |
| | +---+---------------------------------------------+
| | | | | | |
| | | | | Block | |
| | | | | | | |
| | | | +----------------+-------------------+
| | | | | | | |
| +---+ | | | | |
| | | | | CharRange | |
| | StartCond. | | | | |
| | | | | | | |
| | | | | +---+-------+ |
| | | | | | | |
| | | | | CharClass | |
| | | | | | | |
| | | | +---------+ | |
| | | | | | |
| | | | Pattern | |
| | | | | | |
| | | +--------+ | |
| | | | | |
| | | Rule | |
| | | | | |
| | +--------+ | |
| | | | |
| Ranges Rules Decimal Scanner
| | | | |
| +----------------+---------------------+----+---------+
| | |
+--------------------+ |
| | | |
| | +------------------------+
+---+--+ |
| |
DFARow |
| |
DFA Options |
| | |
DFAs +---+---+ |
| | | |
+-------------------------+ +-------+
| |
Generator Parser
| |
+----------------+------------------------+
|
flexc++
The file CLASSES defines the directory containing the sources of the
abovementioned classes. Also, it contains the class dependencies. If a class
depends on a class listed higher up in the class organization then its
immediately superior class is mentioned immediately following its class
name. E.g., for DFARow the CLASSES entry looks like this:
dfarow ranges rules
The icmake build script, when compiling a new version of the program looks for
a file ALL in the class-directories. If found, all the class's sources and all
sources of all classes depending on that class as well as flexc++.cc itself
are recompiled. This allows developers to modify the internal organization of
a class (or the implementation of a member function that's defined inline) and
recompile all sources that may be affected by the modified class. Multiple ALL
files may be touched before calling `build program'. E.g., following
touch options/ALL dfarow/ALL
all sources of DFARow, DFA, Options and Parser, as well as flexc++.cc will be
recompiled.
CharClass: The characters of a character-class
CharRange: produces all predefined character ranges, constructing them
only once, when needed for the first time.
SemVal: parser's semantic value stack data type. A polymorphic base class
StartConditions: defines the rules that are defined in each of the Start
Conditions
StateData: polymorphic base class of all kinds of data that may be stored
in a State. This basic form contains two fields defining states to
transit to from this state.
StateString: derived from StateData, also contains a string.
State: initially a state in an NFA, defined by the parser
States: stores and manages all states
Block: stores action blocks associated with Rules
FStreamInfo: interfaces Scanner to actual input stream(s)
Options: stores all otions/directives
Scanner: performs lexial analysis
Decimal: stores interval values ({x,y} specs)
PatternVal: stores a pattern's type and begin and end state #s
TextVal: plain textual string as-is
Rule: stores where to find the rule's State element in States and the
contents of the rule's action block.
Rules: the vector of Rule elements.
Parser: Handles syntax checks and builds State vector
|