Exemple #1
0
 public Parser(Scanner scanner)
 {
     this.hook         = new ErrorHook();
     this.scanner      = scanner;
     this.currentToken = this.scanner.nextToken();
     this.panic        = false;
 }
Exemple #2
0
 public Parser(ILexer lexer)
 {
     this.lexer        = lexer;
     this.currentToken = this.lexer.nextToken();
     this.hook         = new ErrorHook();
     this.panic        = false;
 }
    public void sendHook(HookType type, string message)
    {
        Hook temp;

        switch (type)
        {
        case HookType.Action:
            temp = new ActionHook(message);
            break;

        case HookType.Error:
            temp = new ErrorHook(message);
            break;

        case HookType.Input:
            temp = new InputHook(message);
            break;

        default:
            temp = new Hook();
            Debug.LogError("sendHook with string parameter could not determine hook type!");
            break;
        }
        passHook(temp);
    }
Exemple #4
0
 protected virtual void errorHook(ErrorHook hook)
 {
     return;
 }
Exemple #5
0
 public TypeCheckingVisitor(SymbolTableManager stm)
 {
     this.stm = stm;
     hook     = new ErrorHook();
 }
Exemple #6
0
 public TypeCheckingVisitor(SymbolTable table)
 {
     this.table = table;
     this.hook  = new ErrorHook();
 }
Exemple #7
0
 public IdentifierUsageCheckingVisitor(SymbolTableManager stm)
 {
     this.stm  = stm;
     this.hook = new ErrorHook();
 }
Exemple #8
0
 public SymbolTableBuildingVisitor()
 {
     this.symbolTables = new SymbolTables();
     this.currentTable = null;
     this.hook         = new ErrorHook();
 }
Exemple #9
0
 public SymbolTableBuildingVisitor()
 {
     this.table = new SymbolTable();
     this.hook  = new ErrorHook();
 }