Package daikon
Class FileIO.VarDefinition
- Object
- 
- VarDefinition
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable
 - Enclosing class:
- FileIO
 
 public static class FileIO.VarDefinition extends Object implements Serializable, Cloneable Class that holds information from the declaration record (in the file). Once collected, this information is used to create a VarInfo. This class is necessary because a VarInfo cannot be created until much of this information is present: the constructor requires all the information at the time of construction, and some of the fields are final.In general, each field has a one-to-one relation with the corresponding entry in the variable definition block in the trace file. More detailed information about each of the fields can be found in the 'Variable declarations' section of the 'File Formats' appendix of the Daikon developers manual. Specifics can also be found in the 'parse_[field]' methods of the class (eg, parse_var_kind, parse_enclosing_var_name, etc). - See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description intarr_dimsNumber of array dimensions (0 or 1).VarComparabilitycomparabilityComparability of this variable (required.ProglangTypedeclared_typeDeclared type of the variable as an arbitrary string (required)@Nullable Stringenclosing_var_nameName of variable that contains this variable (optional)EnumSet<VarInfo.VarFlags>flagsVariable flags (optional)@Nullable List<String>function_argsNon-null iff (vardef.kind == VarKind.FUNCTION).VarInfo.VarKindkindType of the variable (required).EnumSet<VarInfo.LangFlags>lang_flagsLanguage specific variable flags (optional)@Nullable Integermax_lengthNon-null if it is statically known that the array will have up to this many elements.@Nullable Stringmax_valueNon-null if it is statically known that the value of the variable will be always less than or equal to this value.@Nullable Integermin_lengthNon-null if it is statically known that the array will have at least this many elements.@Nullable Stringmin_valueNon-null if it is statically known that the value of the variable will be always greater than or equal to this value.StringnameName of the variable (required).List<VarParent>parentsParent program points in ppt hierarchy (optional)VarInfo.RefTyperef_typeType of reference for structure/class variables.@Nullable Stringrelative_namethe simple (not fully specified) name of this variable (optional)ProglangTyperep_typeThe type of the variable as stored in the dtrace file (required)@Nullable @Interned Objectstatic_constant_valueNon-null if this 'variable' always has the same value (optional)@Nullable Stringvalid_valuesNon-null if the set of valid values for the variable is statically known.
 - 
Constructor SummaryConstructors Constructor Description VarDefinition(FileIO.ParseState state, Scanner scanner)Initialize from the 'variable name' record.VarDefinition(String name, VarInfo.VarKind kind, ProglangType type)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckRep()Check representation invariants.voidclear_parent_relation()Clears the parent relations, if any existed.FileIO.VarDefinitionclone()FileIO.VarDefinitioncopy()@Interned Stringneed(Scanner scanner, String description)Helper function, returns the next string token unescaped and interned.voidneed_eol(Scanner scanner)Throws Daikon.UserError if the scanner is not at end of linevoidparse_array(Scanner scanner)Parses the array record.voidparse_comparability(Scanner scanner)Parses a comparability record.voidparse_constant(Scanner scanner)Parse a constant record.voidparse_dec_type(Scanner scanner)voidparse_enclosing_var_name(Scanner scanner)Parses the enclosing-var record.<E extends Enum<E>>
 Eparse_enum_val(Scanner scanner, Class<E> enum_class, String descr)Looks up the next token as a member of enum_class.voidparse_flags(Scanner scanner)Parse the flags record.voidparse_function_args(Scanner scanner)Parses the function-args record.voidparse_lang_flags(Scanner scanner)Parse the langauge specific flags record.voidparse_max_length(Scanner scanner)Parse a maximum length record.voidparse_max_value(Scanner scanner)Parse a maximum value record.voidparse_min_length(Scanner scanner)Parse a minimum length record.voidparse_min_value(Scanner scanner)Parse a minimum value record.voidparse_parent(Scanner scanner, List<FileIO.ParentRelation> ppt_parents)Parse a parent ppt record.voidparse_reference_type(Scanner scanner)Parses the reference-type record.voidparse_rep_type(Scanner scanner)voidparse_valid_values(Scanner scanner)Parse a valid values record.voidparse_var_kind(Scanner scanner)Parse a var-kind record.
 
- 
- 
- 
Field Detail- 
kindpublic VarInfo.VarKind kind Type of the variable (required).
 - 
enclosing_var_namepublic @Nullable String enclosing_var_name Name of variable that contains this variable (optional)
 - 
relative_namepublic @Nullable String relative_name the simple (not fully specified) name of this variable (optional)
 - 
ref_typepublic VarInfo.RefType ref_type Type of reference for structure/class variables.
 - 
arr_dimspublic int arr_dims Number of array dimensions (0 or 1).
 - 
function_argspublic @Nullable List<String> function_args Non-null iff (vardef.kind == VarKind.FUNCTION). The arguments that were used to create this function application.
 - 
rep_typepublic ProglangType rep_type The type of the variable as stored in the dtrace file (required)
 - 
declared_typepublic ProglangType declared_type Declared type of the variable as an arbitrary string (required)
 - 
flagspublic EnumSet<VarInfo.VarFlags> flags Variable flags (optional)
 - 
lang_flagspublic EnumSet<VarInfo.LangFlags> lang_flags Language specific variable flags (optional)
 - 
comparabilitypublic VarComparability comparability Comparability of this variable (required.
 - 
static_constant_valuepublic @Nullable @Interned Object static_constant_value Non-null if this 'variable' always has the same value (optional)
 - 
min_valuepublic @Nullable String min_value Non-null if it is statically known that the value of the variable will be always greater than or equal to this value.
 - 
max_valuepublic @Nullable String max_value Non-null if it is statically known that the value of the variable will be always less than or equal to this value.
 - 
min_lengthpublic @Nullable Integer min_length Non-null if it is statically known that the array will have at least this many elements.
 - 
max_lengthpublic @Nullable Integer max_length Non-null if it is statically known that the array will have up to this many elements.
 - 
valid_valuespublic @Nullable String valid_values Non-null if the set of valid values for the variable is statically known.
 
- 
 - 
Constructor Detail- 
VarDefinitionpublic VarDefinition(FileIO.ParseState state, Scanner scanner) Initialize from the 'variable name' record. Scanner should be pointing at name.
 - 
VarDefinitionpublic VarDefinition(String name, VarInfo.VarKind kind, ProglangType type) 
 
- 
 - 
Method Detail- 
checkReppublic void checkRep() Check representation invariants.
 - 
clone@SideEffectFree public FileIO.VarDefinition clone(@GuardSatisfied FileIO.VarDefinition this) 
 - 
copypublic FileIO.VarDefinition copy() 
 - 
clear_parent_relationpublic void clear_parent_relation() Clears the parent relations, if any existed.
 - 
parse_var_kindpublic void parse_var_kind(Scanner scanner) Parse a var-kind record. Scanner should be pointing at the variable kind.
 - 
parse_enclosing_var_namepublic void parse_enclosing_var_name(Scanner scanner) Parses the enclosing-var record.
 - 
parse_reference_typepublic void parse_reference_type(Scanner scanner) Parses the reference-type record.
 - 
parse_arraypublic void parse_array(Scanner scanner) Parses the array record.
 - 
parse_function_argspublic void parse_function_args(Scanner scanner) Parses the function-args record.
 - 
parse_rep_typepublic void parse_rep_type(Scanner scanner) 
 - 
parse_dec_typepublic void parse_dec_type(Scanner scanner) 
 - 
parse_flagspublic void parse_flags(Scanner scanner) Parse the flags record. Multiple flags can be specified.
 - 
parse_lang_flagspublic void parse_lang_flags(Scanner scanner) Parse the langauge specific flags record. Multiple flags can be specified.
 - 
parse_comparabilitypublic void parse_comparability(Scanner scanner) Parses a comparability record.
 - 
parse_parentpublic void parse_parent(Scanner scanner, List<FileIO.ParentRelation> ppt_parents) throws Daikon.ParseError Parse a parent ppt record.- Throws:
- Daikon.ParseError
 
 - 
parse_constantpublic void parse_constant(Scanner scanner) Parse a constant record.
 - 
parse_min_valuepublic void parse_min_value(Scanner scanner) Parse a minimum value record.
 - 
parse_max_valuepublic void parse_max_value(Scanner scanner) Parse a maximum value record.
 - 
parse_min_lengthpublic void parse_min_length(Scanner scanner) Parse a minimum length record.
 - 
parse_max_lengthpublic void parse_max_length(Scanner scanner) Parse a maximum length record.
 - 
parse_valid_valuespublic void parse_valid_values(Scanner scanner) Parse a valid values record.
 - 
needpublic @Interned String need(Scanner scanner, String description) Helper function, returns the next string token unescaped and interned. Throw Daikon.UserError if there is no next token.
 - 
need_eolpublic void need_eol(Scanner scanner) Throws Daikon.UserError if the scanner is not at end of line
 - 
parse_enum_valpublic <E extends Enum<E>> E parse_enum_val(Scanner scanner, Class<E> enum_class, String descr) Looks up the next token as a member of enum_class. Throws Daikon.UserError if there is no token or if it is not valid member of the class. Enums are presumed to be in in upper case.
 
- 
 
-