Beispiel #1
0
        void walkFuncionBody(LuaAST st)
        {
            Scope s = new Scope();

            s.StartPos = st.start;
            s.EndPos   = st.end;
            Scope cs = m_currentScope;

            cs.addChild(s);
            m_currentScope = s;
            {
                if (st.Components.ContainsKey("parlist"))
                {
                    if (st.Components["parlist"].Components.ContainsKey("namelist"))
                    {
                        List <LuaVariable> vl = getNamelist(st.Components["parlist"].Components["namelist"]);
                        foreach (LuaVariable var in vl)
                        {
                            Variable v = new Variable(var.Name);
                            v.Type     = m_ac.Types.NullType;
                            v.StartPos = var.StartPos;
                            m_currentScope.addVariable(v);
                        }
                    }
                }

                walkChuck(st.Components["block"]);
            }
            m_currentScope = cs;
        }
Beispiel #2
0
        void walkBlock(LuaAST block)
        {
            Scope s = new Scope();

            s.StartPos = block.start;
            s.EndPos   = block.end;
            Scope cs = m_currentScope;

            cs.addChild(s);
            m_currentScope = s;
            walkChuck(block);
            m_currentScope = cs;
        }
Beispiel #3
0
        void walkForExp(LuaAST st)
        {
            Scope s = new Scope();

            s.StartPos = st.start;
            s.EndPos   = st.end;
            Scope cs = m_currentScope;

            cs.addChild(s);
            m_currentScope = s;
            {
                LuaVariable var = getVariable(st.Components["name"]);
                Variable    v   = new Variable(var.Name);
                v.Type     = getExpressionType(st.Components["initExp"]);//m_ac.Types.get("object");
                v.StartPos = var.StartPos;
                m_currentScope.addVariable(v);

                walkChuck(st.Components["block"]);
            }
            m_currentScope = cs;
        }