コード例 #1
0
            public override void TearDownContext()
            {
                if (relAttNode == null)
                {
                    return;
                }

                AddArgument(new PredicateNode(relAttNode, compare, cNumberNode));
                relAttNode = null;
            }
コード例 #2
0
ファイル: Nodes.cs プロジェクト: tumcms/QL4BIM
 public override string ToString()
 {
     if (SetNode != null)
     {
         return("AttributeAccessNode: " + SetNode.Value + "." + ExAttNode.Value);
     }
     else
     {
         return("AttributeAccessNode: " + RelAttNode.ToShortString() + "." + ExAttNode.Value);
     }
 }
コード例 #3
0
ファイル: Nodes.cs プロジェクト: tumcms/QL4BIM
 public override string ToString()
 {
     if (SetNode != null)
     {
         return("TypePredNode: " + SetNode.Value + " is " + Type);
     }
     else
     {
         return("TypePredNode: " + RelAttNode.ToShortString() + " is " + Type);
     }
 }
コード例 #4
0
            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;
            }
コード例 #5
0
 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();
 }
コード例 #6
0
ファイル: Nodes.cs プロジェクト: tumcms/QL4BIM
 public AttributeAccessNode(RelAttNode relAttNode, ExAttNode exAttNode)
 {
     RelAttNode = relAttNode;
     ExAttNode  = exAttNode;
 }
コード例 #7
0
ファイル: Nodes.cs プロジェクト: tumcms/QL4BIM
 public TypePredNode(RelAttNode relAttNode, string type)
 {
     RelAttNode = relAttNode;
     Type       = type;
 }
コード例 #8
0
            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();
                }
            }