jparse
Class VarList

java.lang.Object
  extended byjparse.VarList

public final class VarList
extends Object

A list of variables whose values are read by an expression or statement, whose values are written by an expression or statement, or which are declared by a statement

Author:
Jerry James

Field Summary
 VarAST[] decl
          The list of variables that are declared
 VarAST[] read
          The list of variables whose values are read
 VarAST[] write
          The list of variables whose values are written
 
Constructor Summary
VarList()
          Create an empty list of variables
VarList(VarAST readVar)
          Create a new list of variables from a single variable
VarList(VarAST[] decls)
          Create a new list of variables from an array of declarations
VarList(VarList[] lists)
          Create a new list of variables by merging an array of lists
VarList(VarList list, VarAST declaration)
          Create a new list of variables by adding a declaration to an existing list
VarList(VarList list1, VarList list2)
          Create a new list of variables by merging two other lists
VarList(VarList list1, VarList list2, boolean assign)
          Create a new list of variables by merging two other lists, and optionally changing reads to writes for the first list
VarList(VarList list1, VarList list2, VarList list3)
          Create a new list of variables by merging three other lists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

read

public final VarAST[] read
The list of variables whose values are read


write

public final VarAST[] write
The list of variables whose values are written


decl

public final VarAST[] decl
The list of variables that are declared

Constructor Detail

VarList

public VarList()
Create an empty list of variables


VarList

public VarList(VarAST readVar)
Create a new list of variables from a single variable

Parameters:
readVar - a variable that is read by the expression or statement

VarList

public VarList(VarAST[] decls)
Create a new list of variables from an array of declarations

Parameters:
decls - the declarations

VarList

public VarList(VarList list,
               VarAST declaration)
Create a new list of variables by adding a declaration to an existing list

Parameters:
list - the existing list
declaration - the declaration to add

VarList

public VarList(VarList list1,
               VarList list2)
Create a new list of variables by merging two other lists

Parameters:
list1 - the first list to merge
list2 - the second list to merge

VarList

public VarList(VarList list1,
               VarList list2,
               boolean assign)
Create a new list of variables by merging two other lists, and optionally changing reads to writes for the first list

Parameters:
list1 - the first list to merge
list2 - the second list to merge
assign - true if this is for an assignment expression, so that reads should be changed to writes for list1

VarList

public VarList(VarList list1,
               VarList list2,
               VarList list3)
Create a new list of variables by merging three other lists

Parameters:
list1 - the first list to merge
list2 - the second list to merge
list3 - the third list to merge

VarList

public VarList(VarList[] lists)
Create a new list of variables by merging an array of lists

Parameters:
lists - the array of lists to merge