Package EDU.purdue.jtb.common
Class UserClassInfo
- java.lang.Object
-
- EDU.purdue.jtb.common.UserClassInfo
-
public class UserClassInfo extends java.lang.ObjectClassUserClassInfois 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 Classes Modifier and Type Class Description classUserClassInfo.CommentDataHolds the data of the lines of a comment or sub comment.classUserClassInfo.CommentLineDataHolds the data of a line of a comment or sub comment.classUserClassInfo.FieldInfoHolds the information for a field (representing a node's child).
-
Field Summary
Fields Modifier and Type Field Description INodeastEcNodeThe corresponding ExpansionChoices nodejava.lang.StringclassNameThe class name (without optional prefix and suffix)java.util.List<UserClassInfo.CommentData>fieldCmtsThe list of the field comments datajava.util.List<UserClassInfo.FieldInfo>fieldsThe list of the class fields representing the node's childrenintfieldsHashSigThe fields hash signature (for helping controlling changes between generated classes versions).java.util.List<UserClassInfo.CommentData>fieldSubCmtsThe list of the sub comments data (without field comments data).
Built and used only when the "inline accept methods" option is on.java.lang.StringfixedClassNameThe class name (including optional prefix and suffix)java.lang.StringBuildervisitFieldCmtsSbThe javadoc formatted field comments used by the visit methods (more than once, so that's why they are stored as an optimization)
-
Constructor Summary
Constructors Constructor Description UserClassInfo(ExpansionChoices aEC, int aNbFields, java.lang.String aCN, java.lang.String aFCN)Constructs an instance giving an ExpansionChoices node and a name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddField(java.lang.String aFT, java.lang.String aFN)Adds a field type, name (with no initializer) to the internal lists.voidaddField(java.lang.String aFT, java.lang.String aFFT, java.lang.String aFN)Adds a field type, name, initializer, code and node to the internal lists.
-
-
-
Field Detail
-
astEcNode
public final INode astEcNode
The corresponding ExpansionChoices node
-
className
public final java.lang.String className
The class name (without optional prefix and suffix)
-
fixedClassName
public final java.lang.String fixedClassName
The class name (including optional prefix and suffix)
-
fields
public final java.util.List<UserClassInfo.FieldInfo> fields
The list of the class fields representing the node's children
-
fieldCmts
public java.util.List<UserClassInfo.CommentData> fieldCmts
The list of the field comments data
-
fieldSubCmts
public java.util.List<UserClassInfo.CommentData> 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 fieldsHashSig
The fields hash signature (for helping controlling changes between generated classes versions). Null if no fields.
-
visitFieldCmtsSb
public java.lang.StringBuilder 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 Detail
-
UserClassInfo
public UserClassInfo(ExpansionChoices aEC, int aNbFields, java.lang.String aCN, java.lang.String aFCN)
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 Detail
-
addField
public void addField(java.lang.String aFT, java.lang.String aFN)Adds a field type, name (with no initializer) to the internal lists.- Parameters:
aFT- - the field typeaFN- - the field name
-
addField
public void addField(java.lang.String aFT, java.lang.String aFFT, java.lang.String aFN)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
-
-