new public virtual DFAResult Input(int action, LexicalAnalysis.Lexical.Token token) { try { return(base.Input(action, token)); } catch (DFAException dfaEx) { throw new SyntaxException(string.Format("{0}, current class:{1}", dfaEx.Message, this.GetType()), this, dfaEx, token); } }
new public virtual DFAResult Input(int action, LexicalAnalysis.Lexical.Token token) { try { DFAResult result; if (CurrentSyntax == null) { result = base.Input(action, token); switch (result) { case DFAResult.Quit: case DFAResult.ElseQuit: Finish(); return(result); default: if (CurrentSyntax == null) { return(result); } break; } } result = CurrentSyntax.Input(action, token); switch (result) { case DFAResult.Quit: _SyntaxList.Add(CurrentSyntax); CurrentSyntax = null; return(Input(action, token)); case DFAResult.ElseQuit: _SyntaxList.Add(CurrentSyntax); CurrentSyntax = null; return(Input(action, token)); } return(DFAResult.Continue); } catch (DFAException dfaEx) { throw new SyntaxException(dfaEx.Message, this, dfaEx, token); } }
public SyntaxException(string message, object curSyntax, DFAException e, LexicalAnalysis.Lexical.Token token) : base(message, e) { _State = e.State; try { _SyntaxType = (SyntaxType)e.Action; } catch { } _Word = token.Text; _Row = token.Row; _Col = token.Col; if (curSyntax != null) { _CurrentSyntax = curSyntax.GetType().Name; } }