Пример #1
0
        int ident()
        {
            int Typecast = Tok.TOK_VOID;

            if (io.getNextChar() == '(')
            {
                io.Message(tok + "[Ident]");

                Var e = call_construct(tok.getValue());
                Typecast = e.getTypeId();

                if (Typecast == Tok.TOK_VOID)
                {
                    io.Abort("PL0147: using void function where expecting a value");
                }

                emit.Call(e);
                tok.scan();
            }
            else
            {
                if (currenttree.FindByName(tok.getValue()) == null)
                {
                    io.Abort("PL0105: undeclared variable");
                }

                Typecast = currenttree.FindByName(tok.getValue()).getTypeId();
                emit.Load(currenttree.FindByName(tok.getValue()));

                io.Message(tok + "[Ident]");
                tok.scan();
            }
            return(Typecast);
        }
Пример #2
0
 void skipWhite()
 {
     while (Char.IsWhiteSpace(io.getNextChar()))
     {
         io.ReadChar();
     }
 }