Esempio n. 1
0
        public static void RunFunction(string function, Token[] functionArguments)
        {
            string output = GetOutput(functionArguments);

            FunctionName result;

            Enum.TryParse(function, out result);

            if (result == FunctionName.PRINT)
            {
                Console.Write(output);
            }

            else if (result == FunctionName.PRINTN)
            {
                Console.WriteLine(output);
            }

            else if (result == FunctionName.UPDATE)
            {
                UpdateVariable(functionArguments);
            }

            else if (result == FunctionName.JUMPTO)
            {
                LinePointer.InsertJump(GetLineJumpNumber(functionArguments));
            }

            else if (result == FunctionName.JUMPONCE)
            {
                LinePointer.InsertJumpOnce(GetLineJumpNumber(functionArguments));
            }

            else if (result == FunctionName.RETURN)
            {
                ReturnPointer(functionArguments);
            }
        }
Esempio n. 2
0
        public void Jumpto(Token[] args)
        {
            int linenumber = GetLineJumpNumber(args);

            LinePointer.InsertJump(linenumber);
        }