Package EDU.purdue.jtb.common
Class UserClassInfo
java.lang.Object
EDU.purdue.jtb.common.UserClassInfo
Class
UserClassInfo
is used by the JTB driver, the visitors and the files generator to store and
retrieve information about a (grammar) user (node) class including its name, the list of its fields, its
comments. It is also used to generate the user node class code.
Class and inner classes maintain state (for a user class), and are not supposed to be run in parallel threads (on the same user class).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Holds the data of the lines of a comment or sub comment.class
Holds the data of a line of a comment or sub comment.class
Holds the information for a field (representing a node's child). -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal INode
The corresponding ExpansionChoices nodefinal String
The class name (without optional prefix and suffix)The list of the field comments datafinal List
<UserClassInfo.FieldInfo> The list of the class fields representing the node's childrenint
The fields hash signature (for helping controlling changes between generated classes versions).The list of the sub comments data (without field comments data).
Built and used only when the "inline accept methods" option is on.final String
The class name (including optional prefix and suffix)The javadoc formatted field comments used by the visit methods (more than once, so that's why they are stored as an optimization) -
Constructor Summary
ConstructorsConstructorDescriptionUserClassInfo
(ExpansionChoices aEC, int aNbFields, String aCN, String aFCN) Constructs an instance giving an ExpansionChoices node and a name. -
Method Summary
-
Field Details
-
astEcNode
The corresponding ExpansionChoices node -
className
The class name (without optional prefix and suffix) -
fixedClassName
The class name (including optional prefix and suffix) -
fields
The list of the class fields representing the node's children -
fieldCmts
The list of the field comments data -
fieldSubCmts
The list of the sub comments data (without field comments data).
Built and used only when the "inline accept methods" option is on. -
fieldsHashSig
public int fieldsHashSigThe fields hash signature (for helping controlling changes between generated classes versions). Null if no fields. -
visitFieldCmtsSb
The javadoc formatted field comments used by the visit methods (more than once, so that's why they are stored as an optimization)
-
-
Constructor Details
-
UserClassInfo
Constructs an instance giving an ExpansionChoices node and a name.- Parameters:
aEC
- - the ExpansionChoices nodeaNbFields
- - the number of fieldsaCN
- - the class nameaFCN
- - the fixed name of the class name
-
-
Method Details
-
addField
Adds a field type, name (with no initializer) to the internal lists.- Parameters:
aFT
- - the field typeaFN
- - the field name
-
addField
Adds a field type, name, initializer, code and node to the internal lists.- Parameters:
aFT
- - the field typeaFFT
- - the fixed name of the field typeaFN
- - the field name
-