public override void TearDownContext() { if (relAttNode == null) { return; } AddArgument(new PredicateNode(relAttNode, compare, cNumberNode)); relAttNode = null; }
public override string ToString() { if (SetNode != null) { return("AttributeAccessNode: " + SetNode.Value + "." + ExAttNode.Value); } else { return("AttributeAccessNode: " + RelAttNode.ToShortString() + "." + ExAttNode.Value); } }
public override string ToString() { if (SetNode != null) { return("TypePredNode: " + SetNode.Value + " is " + Type); } else { return("TypePredNode: " + RelAttNode.ToShortString() + " is " + Type); } }
public override void InitContext() { var predecessor = PopLastArgument(false); if (!(predecessor is RelAttNode)) { throw new QueryException("predecessor arguement must be a RelAtt."); } relAttNode = predecessor as RelAttNode; }
public override void TearDownContext() { //set if (PrimeVariable != null && !SecondaryVariable.HasValue) { AddArgument(new SetNode(PrimeVariable)); } //rel else if (SecondaryVariable.HasValue) { var relAttNode = new RelAttNode(SecondaryVariable.Value, PrimeVariable); AddArgument(relAttNode); } base.TearDownContext(); }
public AttributeAccessNode(RelAttNode relAttNode, ExAttNode exAttNode) { RelAttNode = relAttNode; ExAttNode = exAttNode; }
public TypePredNode(RelAttNode relAttNode, string type) { RelAttNode = relAttNode; Type = type; }
public override void AddNode(string value, ParserParts parserPart) { switch (parserPart) { case ParserParts.SetRelArg: PrimeVariable = value; break; case ParserParts.RelAttStr: PromoteSetArgument(); SecondaryVariable = GetIndexOfAttribute(value); break; case ParserParts.RelAttIndex: PromoteSetArgument(); SecondaryVariable = FromAttIndexToNetIndex(value); break; case ParserParts.ExAtt: AddArgument(DoExAtt(value)); break; //Type Predicate case ParserParts.ExType: TypePredNode typePredNode = null; if (PrimeVariable != null && !SecondaryVariable.HasValue) { typePredNode = new TypePredNode(new SetNode(PrimeVariable), value); } else if (SecondaryVariable.HasValue) { var relAttNode = new RelAttNode(SecondaryVariable.Value, PrimeVariable); typePredNode = new TypePredNode(relAttNode, value); } AddArgument(typePredNode); PrimeVariable = null; SecondaryVariable = null; break; //constants case ParserParts.String: ParentFuncNode.LastStatement.AddArgument(new CStringNode(value)); break; case ParserParts.Number: ParentFuncNode.LastStatement.AddArgument(new CNumberNode(value)); break; case ParserParts.Float: ParentFuncNode.LastStatement.AddArgument(new CFloatNode(value)); break; case ParserParts.Bool: ParentFuncNode.LastStatement.AddArgument(new CBoolNode(value)); break; default: throw new InvalidOperationException(); } }