Пример #1
0
 public VarNode(SourcePosition position, IdentNode name, ExpressionNode defaultValue, bool exported, bool final) : base(position)
 {
     Name         = name;
     DefaultValue = defaultValue;
     Exported     = exported;
     Final        = final;
 }
Пример #2
0
 public TryCatchNode(SourcePosition position, StatementNode @try, StatementNode @catch, IdentNode error) : base(position)
 {
     Try   = @try;
     Catch = @catch;
     Error = error;
     ID    = currentID++;
 }
Пример #3
0
 public RepeatNode(IdentNode iterator, ExpressionNode start, ExpressionNode end, StatementNode statement)
 {
     this.iterator  = iterator;
     this.start     = start;
     this.end       = end;
     this.statement = statement;
 }
Пример #4
0
        public void ProcessConstant(SqlNode constant, bool resolveIdent)
        {
            // If the constant is an IDENT, figure out what it means...
            bool isIdent = (constant.Type == HqlSqlWalker.IDENT || constant.Type == HqlSqlWalker.WEIRD_IDENT);

            if (resolveIdent && isIdent && IsAlias(constant.Text))
            {
                // IDENT is a class alias in the FROM.
                IdentNode ident = (IdentNode)constant;
                // Resolve to an identity column.
                ident.Resolve(false, true);
            }
            else
            {
                // IDENT might be the name of a class.
                IQueryable queryable = _walker.SessionFactoryHelper.FindQueryableUsingImports(constant.Text);
                if (isIdent && queryable != null)
                {
                    constant.Text = queryable.DiscriminatorSQLValue;
                }
                // Otherwise, it's a literal.
                else
                {
                    ProcessLiteral(constant);
                }
            }
        }
Пример #5
0
 public ProcNode(SourcePosition position, IdentNode name, bool exported) : base(position)
 {
     Name       = name;
     Exported   = exported;
     Parameters = new List <ParameterNode>();
     Statements = new List <StatementNode>();
 }
Пример #6
0
 public ForKeyValueIteratorNode(SourcePosition position, IdentNode key, IdentNode value, ExpressionNode from, StatementNode code) : base(position)
 {
     Key   = key;
     Value = value;
     From  = from;
     Code  = code;
 }
Пример #7
0
        private IdentNode parseIdent()
        {
            expect(TokenType.IDENT);
            var ident = new IdentNode(current().Data);

            next();
            return(ident);
        }
Пример #8
0
        private IdentNode ParseIdent()
        {
            Expect(TokenType.IDENT);
            var ident = new IdentNode(Position(), Current().Text);

            Next();
            return(ident);
        }
Пример #9
0
 public ForRangeNode(SourcePosition position, IdentNode iterator, ExpressionNode start, ExpressionNode end, ExpressionNode by, StatementNode code) : base(position)
 {
     Iterator = iterator;
     Start    = start;
     End      = end;
     Code     = code;
     By       = by;
 }
Пример #10
0
 public OptionNode(IdentNode key, ExpressionNode @case, ExpressionNode caseDecision,
                   ExpressionNode defaultDecision)
 {
     Key             = key;
     Case            = @case;
     CaseDecision    = caseDecision;
     DefaultDecision = defaultDecision;
     ID = currentID++;
 }
 private void generateIdent(ILGenerator il, IdentNode node, Dictionary <string, LocalBuilder> locals)
 {
     if (locals.ContainsKey(node.Ident))
     {
         il.Emit(OpCodes.Ldloc, locals[node.Ident]);
     }
     else
     {
         il.Emit(OpCodes.Ldarg_2);
     }
 }
Пример #12
0
        public void Visit(IdentNode node)
        {
            SymbolTableEntry info;

            if (symbolTable.TryLookup(node.Name, out info))
            {
                info.EmitLookup(il);
            }
            else
            {
                OnCodeGenError(new SemanticErrorEventArgs(String.Format("`{0}` is not in scope", node.Name)));
            }
        }
Пример #13
0
 public void VisitIdent(IdentNode node)
 {
     UpdateLine(node);
     if (asm.IsLocal(node.Value))
     {
         asm.GetLocal(node.Value);
     }
     else if (asm.IsUpValue(node.Value))
     {
         GetUpValue(node.Value);
     }
     else
     {
         asm.GetGlobal(node.Value);
     }
 }
Пример #14
0
        IASTNode GenerateSyntheticDotNodeForNonQualifiedPropertyRef(IASTNode property, FromElement fromElement)
        {
            IASTNode dot = (IASTNode)adaptor.Create(DOT, "{non-qualified-property-ref}");

            // TODO : better way?!?
            ((DotNode)dot).PropertyPath = ((FromReferenceNode)property).Path;

            IdentNode syntheticAlias = (IdentNode)adaptor.Create(IDENT, "{synthetic-alias}");

            syntheticAlias.FromElement = fromElement;
            syntheticAlias.IsResolved  = true;

            dot.SetFirstChild(syntheticAlias);
            dot.AddChild(property);

            return(dot);
        }
Пример #15
0
 public void VisitId(IdentNode n)
 {
     idOrNum = new IdentificatorValue(n.Name);
 }
Пример #16
0
 public void VisitIdent(IdentNode node)
 {
     writeLine(node.Ident);
 }
Пример #17
0
 public ForIteratorNode(SourcePosition position, IdentNode iterator, ExpressionNode from, StatementNode code) : base(position)
 {
     Iterator = iterator;
     From     = from;
     Code     = code;
 }
Пример #18
0
 public abstract void VisitIdent(IdentNode node);
Пример #19
0
 public VarNode(IdentNode name, ExpressionNode defaultValue)
 {
     this.name         = name;
     this.defaultValue = defaultValue;
 }
Пример #20
0
 public IdentNodeTests()
 {
     subject = new IdentNode(new SourcePosition(2, 4), "foo");
 }
Пример #21
0
 public void VisitIdent(IdentNode node)
 {
     VisitIdentHandler(node);
 }
Пример #22
0
 public DesignationNode makeDesignationNode(DesignationNode node, IdentNode ident)
 {
     return(null);
 }
 public override void VisitIdent(IdentNode node)
 {
 }
Пример #24
0
 public EnumDeclNode getEnumDecl(IdentNode idNode)
 {
     return(null);
 }
Пример #25
0
        //- enums -------------------------------------------------------------

        public EnumDeclNode startEnumSpec(IdentNode idNode, EnumeratorNode enumer)
        {
            return(null);
        }
Пример #26
0
 public AssignNode(IdentNode name, ExpressionNode value)
 {
     this.name  = name;
     this.value = value;
 }
Пример #27
0
        //- struct/unions -----------------------------------------------------

        //public Declaration makeTypeDeclNode(DeclSpecNode declspecs)
        //{
        //    TypeDeclNode typdef = declspecs.baseType;

        //    Declaration decl = new Declaration();
        //    decl.decls.Add(typdef);
        //    return decl;
        //}

        public StructDeclNode starttructSpec(StructDeclNode node, IdentNode idNode, StructDeclarationNode field, bool isUnion)
        {
            return(null);
        }
Пример #28
0
 public DefNode(IdentNode name)
 {
     this.name  = name;
     parameters = new List <IdentNode>();
     code       = new List <StatementNode>();
 }
Пример #29
0
 public StructDeclNode getStructDecl(IdentNode idNode, bool isUnion)
 {
     return(null);
 }
Пример #30
0
 public EnumDeclNode(IdentNode idNode)
     : base("enum")
 {
     // TODO: Complete member initialization
     this.idNode = idNode;
 }