示例#1
0
 public ExecutionVisitor(Dictionary <string, IProperty> symbolicTable, IPrinter printer, IReader reader)
 {
     this.symbolTable  = symbolicTable;
     this.evaluator    = new EvaluationVisitor(this.symbolTable);           // used for evaluating expressions
     this.voidProperty = new VoidProperty();
     this.printer      = printer;
     this.reader       = reader;
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MiniPLInterpreter.StatementCheckVisitor"/> class.
        /// </summary>
        /// <param name="analyzer">Analyzer.</param>
        public StatementCheckVisitor(SemanticAnalyzer analyzer)
        {
            this.analyzer    = analyzer;
            this.typeChecker = new TypeCheckingVisitor(analyzer);

            // We tend to return a lot of VoidProperties here,
            // but since we don't do anything with them, we
            // use one global VoidProperty object and pass it
            // anytime we need to pass one.
            this.voidProperty = new VoidProperty();
        }
示例#3
0
 public EvaluationVisitor(Dictionary <string, IProperty> symbolTable)
 {
     this.symbolTable  = symbolTable;
     this.voidProperty = new VoidProperty();
 }
示例#4
0
        private VoidProperty voidProperty;          // as with the StatementCheckVisitor, use this to pass all voids

        public TypeCheckingVisitor(SemanticAnalyzer analyzer)
        {
            this.analyzer     = analyzer;
            this.voidProperty = new VoidProperty();
        }