Beispiel #1
0
        protected override object ReallyDoEvaluate(ScriptThread thread)
        {
            var tw = thread.tc().Writer;

            if (AstNode1 is CharacterNode)
            {
                return((AstNode1.Evaluate(thread) as string) + "->value");
            }
            else if (AstNode1 is ConstantNode)
            {
                return(AstNode1.Evaluate(thread));
            }
            else if (AstNode1 is PronounNode)
            {
                return(String.Format("value_of({0},{1})", Location.Line, AstNode1.Evaluate(thread) as string));
            }
            else if (AstNode1 is BinaryOperatorNode)
            {
                return(string.Format(AstNode1.ToString(), Location.Line, AstNode2.Evaluate(thread) as string, AstNode3.Evaluate(thread) as string));
            }
            else if (AstNode1 is UnaryOperatorNode)
            {
                AstNode1.Evaluate(thread);
                return(string.Format((AstNode1 as UnaryOperatorNode).FormatString, AstNode2.Evaluate(thread) as string));
            }
            else
            {
                // error
            }
            return(this);
        }
Beispiel #2
0
        protected override object ReallyDoEvaluate(ScriptThread thread)
        {
            var tw = thread.tc().Writer;

            tw.WriteLine();
            tw.WriteLine("\tactivate_character({0}, {1});", Location.Line, AstNode1.ToString(thread));
            AstNode2.Evaluate(thread);
            return(this);
        }
Beispiel #3
0
        protected override object ReallyDoEvaluate(ScriptThread thread)
        {
            var action = thread.rs().Action.At(Span);
            var name   = AstNode1.ToString(thread);

            action[name] = action.Base().Invoke("InitializeCharacter", Location.Line, name);
            thread.rs().Cast.Add(name, action[name]);
            return(base.ReallyDoEvaluate(thread));
        }
Beispiel #4
0
        protected override object ReallyDoEvaluate(ScriptThread thread)
        {
            var action = thread.rs().Action;
            var person = thread.rs().Cast[AstNode1.ToString()];

            action.At(Span).Invoke(action.Base(), "Activate", Location.Line, person);
            AstNode2.Evaluate(thread);
            return(base.ReallyDoEvaluate(thread));
        }
Beispiel #5
0
        protected override object ReallyDoEvaluate(ScriptThread thread)
        {
            if (AstNode1 is UnconditionalSentenceNode)
            {
                AstNode1.Evaluate(thread);
            }
            else
            {
                var tw = thread.tc().Writer;
                tw.WriteLine("\t\tif({0}) {{", AstNode1.ToString(thread));
                AstNode2.Evaluate(thread);
                tw.WriteLine("\t}");
            }

            return(base.ReallyDoEvaluate(thread));
        }
Beispiel #6
0
        protected override object ReallyDoEvaluate(ScriptThread thread)
        {
            var tw = thread.tc().Writer;

            tw.WriteLine("\t\tCharacter\t{0} = InitializeCharacter({2},\"{0}\");\t\t{1}", AstNode1.ToString(thread), AstNode2.ToString(thread), Location.Line);
            return(this);
        }