public override void Visit(VariableAttributeNode node) { // Variable AttrbuteNode is a combined node. // It can be either a Variable or an Attribute, but not both. // This is mostly to abstract from variables and attributes in differnet queryes. SymbolTable.SetCurrentNode(node); if (node.IsAttribute && CheckDeclared(node.ClassVariableName)) { bool IsCollection = false; node.ClassType = SymbolTable.GetVariableType(node.ClassVariableName); SymbolTable.RetrieveSymbol(node.ClassVariableName, out IsCollection); node.IsCollection = IsCollection; if (SymbolTable.AttributeDefined(node.Name, node.ClassType)) { var AttriType = SymbolTable.GetAttributeType(node.Name, node.ClassType, out IsCollection); } } else { CheckDeclared(node.Name); } }
public override AbstractNode VisitSetQuery([NotNull] GiraphParser.SetQueryContext context) { SetQueryNode SetNode = new SetQueryNode(context.Start.Line, context.Start.Column); // If its Attributes being set if (context.variable() != null) { SetNode.InVariable = Visit(context.variable()); //SetNode.InVariable.Name = context.variable().GetText(); SetNode.SetAttributes = true; foreach (var ExpNode in context.setExpressionAtriSim()) { VariableAttributeNode attribute = Visit(ExpNode.attribute()) as VariableAttributeNode; attribute.ClassVariableName = SetNode.InVariable.Name; // Only set Class Variable if its an attribute attribute.IsAttribute = true; AbstractNode expression = Visit(ExpNode.simpleBoolCompOrExp()); SetNode.Attributes.Add(Tuple.Create(attribute, ExpNode.compoundAssign().GetText(), expression)); } } else { // If its variables being set SetNode.SetVariables = true; foreach (var ExpNode in context.setExpressionVari()) { VariableAttributeNode attribute = Visit(ExpNode.variable()) as VariableAttributeNode; AbstractNode expression = Visit(ExpNode.boolCompOrExp()) as AbstractNode; SetNode.Attributes.Add(Tuple.Create(attribute, ExpNode.compoundAssign().GetText(), expression)); } } if (context.where () != null) { SetNode.WhereCondition = Visit(context.where ()); } return(SetNode); }
public override void Visit(VariableAttributeNode node) { }
public override void Visit(VariableAttributeNode node) { _symbolTable.SetCurrentNode(node); VisitChildren(node); }
public abstract void Visit(VariableAttributeNode node);