Ejemplo n.º 1
0
        static public string resolveAssignment(GlobalVariables g, parser.Assignment assignment)
        {
            string varName = assignment.Variable.Name;

            if (varName == null)
            {
                return("resolveAssignment(): variable name can NOT be empty.");
            }
            g.Variables[varName] = assignment.String;
            return(null);
        }
Ejemplo n.º 2
0
        static public string resolveStatement(GlobalVariables g, parser.Statement statement)
        {
            var assignment = new parser.Assignment().GetType();
            var print      = new parser.Print().GetType();

            if (statement.GetType() == assignment)
            {
                return(resolveAssignment(g, (parser.Assignment)statement));
            }
            else if (statement.GetType() == print)
            {
                return(resolvePrint(g, (parser.Print)statement));
            }
            return("resolveStatement(): undefined statement type.");
        }