|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.sql.SqlOperator
A SqlOperator
is a type of node in a SQL parse tree (it is NOT
a node in a SQL parse tree). It includes functions, operators such as '=',
and syntactic constructs such as 'case' statements.
Nested Class Summary | |
static class |
SqlOperator.Syntax
Syntax enumerates possible syntactic types of operators. |
static interface |
SqlOperator.TypeInference
Strategy to infer the type of an operator call from the type of the operands. |
Field Summary | |
SqlKind |
kind
|
(package private) int |
leftPrec
The precedence with which this operator binds to the expression to the left. |
String |
name
|
(package private) int |
rightPrec
The precedence with which this operator binds to the expression to the right. |
private SqlOperator.TypeInference |
typeInference
|
Constructor Summary | |
(package private) |
SqlOperator(String name,
SqlKind kind,
int prec,
boolean isLeftAssoc,
SqlOperator.TypeInference typeInference)
Creates an operator specifying left/right associativity. |
(package private) |
SqlOperator(String name,
SqlKind kind,
int leftPrecedence,
int rightPrecedence,
SqlOperator.TypeInference typeInference)
Creates an operator. |
Method Summary | |
SqlCall |
createCall()
Creates a call to this operand with no operands. |
SqlCall |
createCall(SqlNode operand)
Creates a call to this operand with a single operand. |
SqlCall |
createCall(SqlNode[] operands)
Creates a call to this operand with an array of operands. |
SqlCall |
createCall(SqlNode operand1,
SqlNode operand2)
Creates a call to this operand with two operands. |
SqlCall |
createCall(SqlNode operand1,
SqlNode operand2,
SqlNode operand3)
Creates a call to this operand with three operands. |
abstract int |
getSyntax()
Returns the syntactic type of this operator, a value from SqlOperator.Syntax . |
SaffronType |
getType(SaffronTypeFactory typeFactory,
SaffronType[] argTypes)
|
SaffronType |
getType(SqlValidator validator,
SqlValidator.Scope scope,
SqlCall call)
|
(package private) boolean |
isA(SqlKind kind)
Returns whether this is a particular operator. |
String |
toString()
|
(package private) abstract void |
unparse(SqlWriter writer,
SqlNode[] operands,
int leftPrec,
int rightPrec)
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final String name
public final SqlKind kind
final int leftPrec
final int rightPrec
private final SqlOperator.TypeInference typeInference
Constructor Detail |
SqlOperator(String name, SqlKind kind, int leftPrecedence, int rightPrecedence, SqlOperator.TypeInference typeInference)
SqlOperator(String name, SqlKind kind, int prec, boolean isLeftAssoc, SqlOperator.TypeInference typeInference)
Method Detail |
public String toString()
toString
in class Object
public abstract int getSyntax()
SqlOperator.Syntax
.
public SqlCall createCall(SqlNode[] operands)
public SqlCall createCall()
public SqlCall createCall(SqlNode operand)
public SqlCall createCall(SqlNode operand1, SqlNode operand2)
public SqlCall createCall(SqlNode operand1, SqlNode operand2, SqlNode operand3)
abstract void unparse(SqlWriter writer, SqlNode[] operands, int leftPrec, int rightPrec)
boolean isA(SqlKind kind)
public SaffronType getType(SqlValidator validator, SqlValidator.Scope scope, SqlCall call)
public SaffronType getType(SaffronTypeFactory typeFactory, SaffronType[] argTypes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |