/// <summary> /// this implements the evaluation functionality, cannot be used directly /// </summary> /// <param name="tree">the parsetree itself</param> /// <param name="paramlist">optional input parameters</param> /// <returns>a partial result of the evaluation</returns> internal object Eval(ParseTree tree, params object[] paramlist) { object Value = null; switch (Token.Type) { case TokenType.Start: Value = EvalStart(tree, paramlist); break; case TokenType.instruction_block: Value = Evalinstruction_block(tree, paramlist); break; case TokenType.instruction: Value = Evalinstruction(tree, paramlist); break; case TokenType.set_stmt: Value = Evalset_stmt(tree, paramlist); break; case TokenType.if_stmt: Value = Evalif_stmt(tree, paramlist); break; case TokenType.until_stmt: Value = Evaluntil_stmt(tree, paramlist); break; case TokenType.lock_stmt: Value = Evallock_stmt(tree, paramlist); break; case TokenType.unlock_stmt: Value = Evalunlock_stmt(tree, paramlist); break; case TokenType.print_stmt: Value = Evalprint_stmt(tree, paramlist); break; case TokenType.on_stmt: Value = Evalon_stmt(tree, paramlist); break; case TokenType.toggle_stmt: Value = Evaltoggle_stmt(tree, paramlist); break; case TokenType.wait_stmt: Value = Evalwait_stmt(tree, paramlist); break; case TokenType.when_stmt: Value = Evalwhen_stmt(tree, paramlist); break; case TokenType.onoff_stmt: Value = Evalonoff_stmt(tree, paramlist); break; case TokenType.stage_stmt: Value = Evalstage_stmt(tree, paramlist); break; case TokenType.clear_stmt: Value = Evalclear_stmt(tree, paramlist); break; case TokenType.add_stmt: Value = Evaladd_stmt(tree, paramlist); break; case TokenType.remove_stmt: Value = Evalremove_stmt(tree, paramlist); break; case TokenType.log_stmt: Value = Evallog_stmt(tree, paramlist); break; case TokenType.break_stmt: Value = Evalbreak_stmt(tree, paramlist); break; case TokenType.preserve_stmt: Value = Evalpreserve_stmt(tree, paramlist); break; case TokenType.declare_stmt: Value = Evaldeclare_stmt(tree, paramlist); break; case TokenType.switch_stmt: Value = Evalswitch_stmt(tree, paramlist); break; case TokenType.copy_stmt: Value = Evalcopy_stmt(tree, paramlist); break; case TokenType.rename_stmt: Value = Evalrename_stmt(tree, paramlist); break; case TokenType.delete_stmt: Value = Evaldelete_stmt(tree, paramlist); break; case TokenType.edit_stmt: Value = Evaledit_stmt(tree, paramlist); break; case TokenType.run_stmt: Value = Evalrun_stmt(tree, paramlist); break; case TokenType.filevol_name: Value = Evalfilevol_name(tree, paramlist); break; case TokenType.list_stmt: Value = Evallist_stmt(tree, paramlist); break; case TokenType.reboot_stmt: Value = Evalreboot_stmt(tree, paramlist); break; case TokenType.shutdown_stmt: Value = Evalshutdown_stmt(tree, paramlist); break; case TokenType.for_stmt: Value = Evalfor_stmt(tree, paramlist); break; case TokenType.unset_stmt: Value = Evalunset_stmt(tree, paramlist); break; case TokenType.batch_stmt: Value = Evalbatch_stmt(tree, paramlist); break; case TokenType.deploy_stmt: Value = Evaldeploy_stmt(tree, paramlist); break; case TokenType.arglist: Value = Evalarglist(tree, paramlist); break; case TokenType.expr: Value = Evalexpr(tree, paramlist); break; case TokenType.and_expr: Value = Evaland_expr(tree, paramlist); break; case TokenType.compare_expr: Value = Evalcompare_expr(tree, paramlist); break; case TokenType.arith_expr: Value = Evalarith_expr(tree, paramlist); break; case TokenType.multdiv_expr: Value = Evalmultdiv_expr(tree, paramlist); break; case TokenType.factor: Value = Evalfactor(tree, paramlist); break; case TokenType.atom: Value = Evalatom(tree, paramlist); break; case TokenType.sci_number: Value = Evalsci_number(tree, paramlist); break; case TokenType.number: Value = Evalnumber(tree, paramlist); break; case TokenType.array_identifier: Value = Evalarray_identifier(tree, paramlist); break; case TokenType.varidentifier: Value = Evalvaridentifier(tree, paramlist); break; case TokenType.function_identifier: Value = Evalfunction_identifier(tree, paramlist); break; default: Value = Token.Text; break; } return(Value); }
protected virtual object EvalStart(ParseTree tree, params object[] paramlist) { return("Could not interpret input; no semantics implemented."); }
protected object GetValue(ParseTree tree, TokenType type, int index) { return(GetValue(tree, type, ref index)); }