Ejemplo n.º 1
0
        private AegisFunc MatchFunc()
        {
            var af = new AegisFunc();

            af.Name = MatchIdent();

            if (af.Name == "showimage")
            {
            }

            while (tk.Type != TokenType.NewLine && tk.Type != TokenType.EOF)
            {
                Expr exp = MatchExpr(false);

                if (fallback)
                {
                    return(null);
                }

                af.Items.Add(exp);
            }

            MatchNewline();

            return(af);
        }
Ejemplo n.º 2
0
        private void GenFunc(AegisFunc aegisFunc)
        {
            lastFunc      = aegisFunc;
            lastFunc.Name = lastFunc.Name.ToLower();

            string str = TranslateFunc(aegisFunc.Name, aegisFunc.Items);

            if (str == "")
            {
                return;
            }

            WriteNewLine(str + ";");
        }
Ejemplo n.º 3
0
        private string TranslateExpr(Expr expr)
        {
            if (expr.GetType() == typeof(FuncCall))
            {
                var af = new AegisFunc();
                af.Name  = ((FuncCall)expr).Name;
                af.Items = new List <AegisItem>();
                foreach (Expr exp in ((FuncCall)expr).Args)
                {
                    af.Items.Add(exp);
                }

                return(TranslateFunc(af.Name, af.Items));
            }

            return(expr.ToString());
        }
Ejemplo n.º 4
0
        private void GenWarp(AegisWarp aw)
        {
            AegisLabel ontouch = null;

            foreach (AegisLabel al in aw.Items)
            {
                if (al.Name == "OnTouch")
                {
                    ontouch = al;
                    break;
                }
            }

            if (ontouch == null)
            {
                return;
            }

            AegisFunc moveto = null;

            foreach (AegisFunc af in ontouch.Items)
            {
                if (af.Name == "moveto")
                {
                    moveto = af;
                    break;
                }
            }

            if (moveto == null)
            {
                return;
            }

            curArgs = moveto.Items;

            WriteNewLine("{0},{1},{2},{3}\twarp\t{4}\t{5},{6},{7},{8},{9}\n", aw.MapName, aw.x, aw.y, "0", aw.name,
                         aw.spanx, aw.spany, FindArg(0).Substring(1, FindArg(0).Length - 2), FindArg(1), FindArg(2));
        }