Ejemplo n.º 1
0
        protected Node IdentInline()
        {
            string name = ((TokenWithContent <string>)Current).Content;

            Accept(TT.TT_IdentInline);

            List <Node> parameter = new List <Node>();

            while (Current.TokenType != TT.TT_ParenRight)
            {
                switch (Current.TokenType)
                {
                case TT.TT_IdentTRUEFALSE:
                case TT.TT_Minus:
                case TT.TT_Plus:
                case TT.TT_ParenLeft:
                case TT.TT_IntNumber:
                case TT.TT_DoubleNumber:
                case TT.TT_Dollar:
                case TT.TT_String:
                case TT.TT_IdentInline:
                case TT.TT_IdentCast:
                    parameter.Add(Addition());
                    break;

                case TT.TT_IdentCALLC:
                    parameter.Add(CALLC());
                    break;

                case TT.TT_IdentCALLO:
                    parameter.Add(CALLO());
                    break;

                case TT.TT_IdentID:
                    parameter.Add(ID());
                    break;

                default:
#warning Script Implement Error Handling
                    Console.WriteLine("Error - 17");
                    break;
                }
                if (Current.TokenType == TT.TT_Comma)
                {
                    Accept(TT.TT_Comma);
                }
            }
            Accept(TT.TT_ParenRight);
            Function f = FunctionLib.GetFunction(name);

            if (f == null)
            {
#warning Script Implement Error Handling
                Console.WriteLine("Error - 18");
            }

            return(f.GetFunctionNode(parameter));
        }
Ejemplo n.º 2
0
        protected Node Ident()
        {
            string name = ((TokenWithContent <string>)Current).Content;

            Accept(TT.TT_Ident);

            List <Node> parameter = new List <Node>();

            while (Current.TokenType != TT.TT_Semicolon)
            {
                switch (Current.TokenType)
                {
                case TT.TT_IdentTRUEFALSE:
                case TT.TT_Minus:
                case TT.TT_Plus:
                case TT.TT_ParenLeft:
                case TT.TT_IntNumber:
                case TT.TT_DoubleNumber:
                case TT.TT_Dollar:
                case TT.TT_String:
                case TT.TT_IdentInline:
                case TT.TT_IdentCast:
                    parameter.Add(Klammer());
                    break;

                case TT.TT_IdentCALLC:
                    parameter.Add(CALLC());
                    break;

                case TT.TT_IdentCALLO:
                    parameter.Add(CALLO());
                    break;

                case TT.TT_IdentID:
                    parameter.Add(ID());
                    break;

                default:
#warning Script Implement Error Handling
                    Console.WriteLine("Error - 19");
                    break;
                }
            }

            Function f = FunctionLib.GetFunction(name);

            if (f == null)
            {
#warning Script Implement Error Handling
                Console.WriteLine("Error - 20(Unknown function({0}) in {1}!", name, this.FunctionName);
            }

            return(f.GetFunctionNode(parameter));
        }
Ejemplo n.º 3
0
 static FunctionLib()
 {
     FunctionLib.Load();
 }