コード例 #1
0
 private void registerSchema(String variable, String schema, int line, int column) {
   if (variable != null) {
     context.registerSchema(variable, schema, line, column);
   } else {
     // UPDATE and DELETE may not define a variable =>
     // use schema name as variable
     context.registerSchema(calculateCanonicalName(schema), schema, line, column);
   }
 }
コード例 #2
0
ファイル: LengthNode.java プロジェクト: matthewoliver/SpyD
 /** INTERNAL Validate the current node and calculates its type. */
 public void validate(ParseTreeContext context) {
   TypeHelper typeHelper = context.getTypeHelper();
   if (left != null) {
     left.validate(context);
     left.validateParameter(context, typeHelper.getStringType());
   }
   setType(typeHelper.getIntType());
 }
コード例 #3
0
 public Object newVariableDecl(int line, int column, Object path, String variable) {
   DotNode dotNode = (DotNode) path;
   AttributeNode rightNode = (AttributeNode) dotNode.getRight();
   JoinDeclNode node = new JoinDeclNode();
   node.setPath(dotNode);
   node.setVariableName(variable);
   setPosition(node, line, column);
   context.registerJoinVariable(node.getCanonicalVariableName(), dotNode, line, column);
   currentIdentificationVariable = variable;
   return node;
 }
コード例 #4
0
 public Object newFetchJoin(int line, int column, boolean outerJoin, Object path) {
   DotNode dotNode = (DotNode) path;
   AttributeNode rightNode = (AttributeNode) dotNode.getRight();
   rightNode.setOuterJoin(outerJoin);
   // register the dot expression to be added as joined attribute
   FetchJoinNode node = new FetchJoinNode();
   node.setPath(dotNode);
   node.setOuterJoin(outerJoin);
   setPosition(node, line, column);
   context.registerFetchJoin(dotNode.getLeft().getAsString(), dotNode);
   return node;
 }
コード例 #5
0
 public Object newCollectionMemberVariableDecl(
     int line, int column, Object path, String variable) {
   DotNode dotNode = (DotNode) path;
   AttributeNode rightNode = (AttributeNode) dotNode.getRight();
   // The IN-clause expression must be a collection valued path expression
   rightNode.setRequiresCollectionAttribute(true);
   CollectionMemberDeclNode node = new CollectionMemberDeclNode();
   node.setPath(dotNode);
   node.setVariableName(variable);
   setPosition(node, line, column);
   context.registerJoinVariable(node.getCanonicalVariableName(), dotNode, line, column);
   currentIdentificationVariable = variable;
   return node;
 }
コード例 #6
0
 /** INTERNAL Validate node and calculate its type. */
 public void validate(ParseTreeContext context) {
   TypeHelper typeHelper = context.getTypeHelper();
   if (findIn != null) {
     findIn.validate(context);
     findIn.validateParameter(context, typeHelper.getStringType());
   }
   if (find != null) {
     find.validate(context);
     find.validateParameter(context, typeHelper.getStringType());
   }
   if (startPosition != null) {
     startPosition.validate(context);
     startPosition.validateParameter(context, typeHelper.getIntType());
   }
   setType(typeHelper.getIntType());
 }
コード例 #7
0
 public Object newNamedParameter(int line, int column, String name) {
   ParameterNode node = new ParameterNode(name);
   context.addParameter(name);
   setPosition(node, line, column);
   return node;
 }
コード例 #8
0
 public Object newPositionalParameter(int line, int column, String position) {
   ParameterNode node = new ParameterNode(position);
   context.addParameter(position);
   setPosition(node, line, column);
   return node;
 }
コード例 #9
0
 /** INTERNAL Validate node and calculate its type. */
 public void validate(ParseTreeContext context) {
   TypeHelper typeHelper = context.getTypeHelper();
   setType(typeHelper.getBooleanType());
 }