public class InferenceDeclaration extends Declaration implements CodeGenerator
Modifier and Type | Class and Description |
---|---|
static class |
InferenceDeclaration.Clause
An intermediate class used during parsing to represent the various clauses of an inference
declaration.
|
static class |
InferenceDeclaration.HeadFinder
A head finder is a method that finds the head object for an inference given another object.
|
static class |
InferenceDeclaration.NormalizerDeclaration
A normalizer declaration is a clause of an inference declaration that specifies a normalizer
to be used in association with a particular learning classifier or in general.
|
Modifier and Type | Field and Description |
---|---|
InstanceCreationExpression |
algorithm
(ø) A constructor for the inference algorithm to use.
|
ConstraintDeclaration |
constraint
(¬ø) The constraint that must be respected during optimization.
|
static InstanceCreationExpression |
defaultInferenceConstructor
If no inference algorithm is specified, this algorithm is used.
|
Argument |
head
(¬ø) A specification of the object from which all variables can be found.
|
InferenceDeclaration.HeadFinder[] |
headFinders
(¬ø) The methods used to find the head object given objects of different types.
|
InferenceDeclaration.NormalizerDeclaration[] |
normalizerDeclarations
(¬ø) Declarations describing how the scores produced by various learning
classifiers should be normalized.
|
int |
subjecttoClauses
Counts the number of
subjectto clauses for error detection. |
int |
withClauses
Counts the number of
with clauses for error detection. |
comment, name
byteOffset, line, nodeID, symbolTable
Constructor and Description |
---|
InferenceDeclaration(String com,
int line,
int byteOffset,
Name n,
Argument h,
InferenceDeclaration.HeadFinder[] f,
InferenceDeclaration.NormalizerDeclaration[] d,
ConstraintDeclaration con,
InstanceCreationExpression a)
Full constructor.
|
InferenceDeclaration(TokenValue t,
TokenValue i,
Argument h,
LinkedList c)
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.
|
boolean |
containsTypeSpecificNormalizer()
Returns
true iff at least one of the normalizer declarations is specific to a
given type. |
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
InferenceDeclaration . |
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 static final InstanceCreationExpression defaultInferenceConstructor
public Argument head
public InferenceDeclaration.HeadFinder[] headFinders
public InferenceDeclaration.NormalizerDeclaration[] normalizerDeclarations
public ConstraintDeclaration constraint
public int subjecttoClauses
subjectto
clauses for error detection.public InstanceCreationExpression algorithm
public int withClauses
with
clauses for error detection.public InferenceDeclaration(String com, int line, int byteOffset, Name n, Argument h, InferenceDeclaration.HeadFinder[] f, InferenceDeclaration.NormalizerDeclaration[] d, ConstraintDeclaration con, InstanceCreationExpression a)
com
- 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 inference's name.h
- The specification of the head object.f
- An array of methods used to find the head object.d
- An array of normalizer declarations.con
- The constraint this inference must respect.a
- A constructor for the inference algorithm.public InferenceDeclaration(TokenValue t, TokenValue i, Argument h, LinkedList c)
t
- The first token indicates line and byte offset information.i
- The identifier token representing the classifier's name.h
- The specification of the head object.c
- A list of clauses from the body of the declaration.public boolean containsTypeSpecificNormalizer()
true
iff at least one of the normalizer declarations is specific to a
given type.public Type getType()
getType
in class Declaration
public String getName()
InferenceDeclaration
.getName
in interface CodeGenerator
public int getLine()
CodeGenerator
.getLine
in interface CodeGenerator
CodeGenerator
public StringBuffer shallow()
write(StringBuffer)
is that this method omits
the subjectto
clause.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.