Exemplo n.º 1
0
        public void InterpreteSet()
        {
            AST CurrentAST = Input.Read();

            if ((CurrentAST.Target as AST).ASTType == AST.Classification.Of)
            {
                InterpreteOf(CurrentAST.Target as AST);
                OutputManager.Set(Maybe(CurrentAST.Value as AST, InterpreteIdentifier, InterpreteNumber, InterpreteBoolean, InterpreteString));
                return;
            }
            string property = InterpreteIdentifier(CurrentAST.Target as AST) as string;

            OutputManager.Select(property);

            object result = null;

            if (Expected(AST.Classification.Identifier, NextAST: CurrentAST.Value as AST))
            {
                result = OutputManager.FindObject((InterpreteIdentifier(CurrentAST.Value as AST) as string));
            }
            else
            {
                result = Maybe(CurrentAST.Value as AST, InterpreteNumber, InterpreteBoolean, InterpreteString);
            }

            OutputManager.Set(result);
        }