public class ConstraintDeclaration extends Declaration implements CodeGenerator
discrete{false, true}
.Modifier and Type | Field and Description |
---|---|
Argument |
argument
(¬ø) The input specification of the constraint.
|
Block |
body
(¬ø) Statements making up the body of the constraint.
|
comment, name
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
ConstraintDeclaration(String c,
int line,
int byteOffset,
Name n,
Argument a,
Block b)
Full constructor.
|
ConstraintDeclaration(TokenValue t,
TokenValue i,
Argument a,
Block b)
Parser's constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a new object with the same primitive data, and recursively creates new member data
objects as well.
|
int |
getLine()
Returns the line number on which this AST node is found in the source (starting from line 0).
|
String |
getName()
Returns the name of the
ConstraintDeclaration . |
Type |
getType()
Returns the type of the declaration.
|
ASTNodeIterator |
iterator()
Returns an iterator used to successively access the children of this node.
|
void |
runPass(Pass pass)
Ensures that the correct
run() method is called for this type of node. |
StringBuffer |
shallow()
Returns a shallow textual representation of this AST node.
|
void |
write(StringBuffer buffer)
Writes a string representation of this
ASTNode to the specified buffer. |
public Argument argument
public Block body
public ConstraintDeclaration(String c, int line, int byteOffset, Name n, Argument a, Block b)
c
- A Javadoc comment associated with the declaration.line
- The line on which the source code represented by this node is found.byteOffset
- The byte offset from the beginning of the source file at which the source
code represented by this node is found.n
- The constraint's name.a
- The input specification of the constraint.b
- The code block representing the constraint.public ConstraintDeclaration(TokenValue t, TokenValue i, Argument a, Block b)
t
- The first token indicates line and byte offset information.i
- The identifier token representing the constraint's name.a
- The input specification of the constraint.b
- The code block representing the constraint.public Type getType()
getType
in class Declaration
public String getName()
ConstraintDeclaration
.getName
in interface CodeGenerator
public int getLine()
CodeGenerator
.getLine
in interface CodeGenerator
CodeGenerator
public StringBuffer shallow()
shallow
in interface CodeGenerator
public ASTNodeIterator iterator()
iterator
in class Declaration
public Object clone()
public void runPass(Pass pass)
run()
method is called for this type of node.public void write(StringBuffer buffer)
ASTNode
to the specified buffer. The
representation written is parsable by the LBJava compiler, but not very readable.Copyright © 2016. All rights reserved.