public ParserEngine(TransitionTable transitions, SyntaxErrors errorDef) { CodeContract.RequiresArgumentNotNull(transitions, "transitions"); CodeContract.RequiresArgumentNotNull(errorDef, "errorDef"); m_transitions = transitions; m_reducer = new ReduceVisitor(transitions); m_heads = new List<ParserHead>(); m_shiftedHeads = new List<ParserHead>(); m_acceptedHeads = new List<ParserHead>(); m_errorCandidates = new List<ParserHead>(); m_tempHeads = new List<ParserHead>(); m_reducedHeads = new List<ParserHead>(); m_recoverReducedHeads = new List<ParserHead>(); m_errorDef = errorDef; m_cleaner = new ParserHeadCleaner(); EnableDeletionRecovery = true; EnableInsertionRecovery = true; EnableReplacementRecovery = true; //init state m_heads.Add(new ParserHead(new StackNode(0, null, null))); }
protected virtual void OnDefineParserErrors(SyntaxErrors errorDefinition, CompilationErrorManager errorManager) { errorManager.DefineError(errorDefinition.LexicalErrorId, 0, CompilationStage.Scanning, "Invalid token: {0}"); errorManager.DefineError(errorDefinition.TokenUnexpectedId, 0, CompilationStage.Parsing, "Unexpected token: {0}"); errorManager.DefineError(errorDefinition.TokenMissingId, 0, CompilationStage.Parsing, "Missing token: {0}"); errorManager.DefineError(errorDefinition.OtherErrorId, 0, CompilationStage.Parsing, "Syntax error"); }
public ParserEngine(TransitionTable transitions, SyntaxErrors errorDef) { CodeContract.RequiresArgumentNotNull(transitions, "transitions"); CodeContract.RequiresArgumentNotNull(errorDef, "errorDef"); m_transitions = transitions; m_reducer = new ReduceVisitor(transitions); m_heads = new List <ParserHead>(); m_shiftedHeads = new List <ParserHead>(); m_acceptedHeads = new List <ParserHead>(); m_errorCandidates = new List <ParserHead>(); m_tempHeads = new List <ParserHead>(); m_reducedHeads = new List <ParserHead>(); m_recoverReducedHeads = new List <ParserHead>(); m_errorDef = errorDef; m_cleaner = new ParserHeadCleaner(); EnableDeletionRecovery = true; EnableInsertionRecovery = true; EnableReplacementRecovery = true; //init state m_heads.Add(new ParserHead(new StackNode(0, null, null))); }
protected ParserBase(CompilationErrorManager errorManager) { CodeContract.RequiresArgumentNotNull(errorManager, "errorManager"); m_errorManager = errorManager; m_errorDefinition = new SyntaxErrors() { LexicalErrorId = 101, TokenUnexpectedId = 201, TokenMissingId = 202, OtherErrorId = 203 }; m_triviaTokens = new List <Token>(); }
public ParserEngine(TransitionTable transitions, SyntaxErrors errorDef) { CodeContract.RequiresArgumentNotNull(transitions, "transitions"); CodeContract.RequiresArgumentNotNull(errorDef, "errorDef"); m_transitions = transitions; m_reducer = new ReduceVisitor(transitions); m_heads = new List<ParserHead>(); m_tempHeads = new List<ParserHead>(); m_acceptedHeads = new List<ParserHead>(); m_errorCandidates = new List<ParserHead>(); m_errorDef = errorDef; //init state m_heads.Add(new ParserHead(new StackNode(0, null, null))); }
protected ParserBase(CompilationErrorManager errorManager) { CodeContract.RequiresArgumentNotNull(errorManager, "errorManager"); m_errorManager = errorManager; m_errorDefinition = new SyntaxErrors() { LexicalErrorId = 101, TokenUnexpectedId = 201, TokenMissingId = 202, TokenMistakeId = 203, OtherErrorId = 200 }; m_triviaTokens = new List <Token>(); EnableReplacementRecovery = true; EnableInsertionRecovery = true; EnableDeletionRecovery = true; }