Example #1
0
 public VarNode(SourcePosition position, IdentNode name, ExpressionNode defaultValue, bool exported, bool final) : base(position)
 {
     Name         = name;
     DefaultValue = defaultValue;
     Exported     = exported;
     Final        = final;
 }
Example #2
0
 public TryCatchNode(SourcePosition position, StatementNode @try, StatementNode @catch, IdentNode error) : base(position)
 {
     Try   = @try;
     Catch = @catch;
     Error = error;
     ID    = currentID++;
 }
Example #3
0
 public RepeatNode(IdentNode iterator, ExpressionNode start, ExpressionNode end, StatementNode statement)
 {
     this.iterator  = iterator;
     this.start     = start;
     this.end       = end;
     this.statement = statement;
 }
Example #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);
                }
            }
        }
Example #5
0
 public ProcNode(SourcePosition position, IdentNode name, bool exported) : base(position)
 {
     Name       = name;
     Exported   = exported;
     Parameters = new List <ParameterNode>();
     Statements = new List <StatementNode>();
 }
 public ForKeyValueIteratorNode(SourcePosition position, IdentNode key, IdentNode value, ExpressionNode from, StatementNode code) : base(position)
 {
     Key   = key;
     Value = value;
     From  = from;
     Code  = code;
 }
Example #7
0
        private IdentNode parseIdent()
        {
            expect(TokenType.IDENT);
            var ident = new IdentNode(current().Data);

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

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

        public EnumDeclNode startEnumSpec(IdentNode idNode, EnumeratorNode enumer)
        {
            return(null);
        }
Example #26
0
 public AssignNode(IdentNode name, ExpressionNode value)
 {
     this.name  = name;
     this.value = value;
 }
Example #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);
        }
Example #28
0
 public DefNode(IdentNode name)
 {
     this.name  = name;
     parameters = new List <IdentNode>();
     code       = new List <StatementNode>();
 }
Example #29
0
 public StructDeclNode getStructDecl(IdentNode idNode, bool isUnion)
 {
     return(null);
 }
Example #30
0
 public EnumDeclNode(IdentNode idNode)
     : base("enum")
 {
     // TODO: Complete member initialization
     this.idNode = idNode;
 }