private SymbolType State7() { // Escape this.action = AutomatonAction.Move; this.state = 6; return(SymbolType.Invalid); }
private SymbolType State5(string c) { if (Regex.IsMatch(c, "[^a-zA-Z_]")) { this.action = AutomatonAction.Recognize; this.state = 0; } return(SymbolType.Identifier); }
private SymbolType State4(string c) { if (Regex.IsMatch(c, "[^0-9]")) { this.action = AutomatonAction.Recognize; this.state = 0; } return(SymbolType.IntegerValue); }
private SymbolType State15(string c) { if (Regex.IsMatch(c, "\n|\r|\r\n")) { this.action = AutomatonAction.Recognize; this.state = 0; } else { this.action = AutomatonAction.Move; } return(SymbolType.Comment); }
private SymbolType State16(string c) { if (Regex.IsMatch(c, "\\*")) { this.action = AutomatonAction.Move; this.state = 17; } else { this.action = AutomatonAction.Move; } return(SymbolType.Invalid); }
private SymbolType State20(string c) { if (Regex.IsMatch(c, "[^=]")) { this.action = AutomatonAction.Recognize; this.state = 0; } else { this.state = 21; } return(SymbolType.Operator); }
private SymbolType State10(string c) { if (Regex.IsMatch(c, "\\.")) { this.action = AutomatonAction.Move; this.state = 11; } else { this.action = AutomatonAction.Recognize; this.state = 0; } return(SymbolType.Invalid); }
private SymbolType State14(string c) { if (Regex.IsMatch(c, "\\/")) { this.action = AutomatonAction.Move; this.state = 15; } else if (Regex.IsMatch(c, "\\*")) { this.action = AutomatonAction.Move; this.state = 16; } else { this.action = AutomatonAction.Recognize; this.state = 0; } return(SymbolType.Operator); }
private SymbolType State11() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.Range); }
private SymbolType State19() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.Exclamation); }
private SymbolType State18() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.MultilineComment); }
private SymbolType State2() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.Assignment); }
private SymbolType State3() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.SemiColon); }
private SymbolType State13() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.RightParenthesis); }
public DFAutomaton() { this.state = 0; this.action = AutomatonAction.Move; }
private SymbolType State21() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.Operator); }
private SymbolType State8() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.StringValue); }
private SymbolType State22() { this.action = AutomatonAction.Recognize; this.state = 0; return(SymbolType.Minus); }
private SymbolType State0(string c) { if (Regex.IsMatch(c, "\n|\r|\r\n")) { // NewLine this.action = AutomatonAction.Error; return(SymbolType.NewLine); } else if (Regex.IsMatch(c, "\\s")) { // WhiteSpace needs to be returned separately this.action = AutomatonAction.Error; return(SymbolType.WhiteSpace); } else if (Regex.IsMatch(c, ":")) { this.action = AutomatonAction.Move; this.state = 1; } else if (Regex.IsMatch(c, ";")) { this.action = AutomatonAction.Move; this.state = 3; } else if (Regex.IsMatch(c, "[a-zA-Z]")) { this.action = AutomatonAction.Move; this.state = 5; } else if (Regex.IsMatch(c, "[0-9]")) { this.action = AutomatonAction.Move; this.state = 4; } else if (Regex.IsMatch(c, "\"")) { this.action = AutomatonAction.Move; this.state = 6; } else if (Regex.IsMatch(c, "\\+|\\*|\\=|\\&")) { this.action = AutomatonAction.Move; this.state = 9; } else if (Regex.IsMatch(c, "\\.")) { this.action = AutomatonAction.Move; this.state = 10; } else if (Regex.IsMatch(c, "\\(")) { this.action = AutomatonAction.Move; this.state = 12; } else if (Regex.IsMatch(c, "\\)")) { this.action = AutomatonAction.Move; this.state = 13; } else if (Regex.IsMatch(c, "\\/")) { this.action = AutomatonAction.Move; this.state = 14; } else if (Regex.IsMatch(c, "!")) { this.action = AutomatonAction.Move; this.state = 19; } else if (Regex.IsMatch(c, "\\<|\\>")) { this.action = AutomatonAction.Move; this.state = 20; } else if (Regex.IsMatch(c, "\\-|\\−")) { this.action = AutomatonAction.Move; this.state = 22; } else { this.action = AutomatonAction.Error; } return(SymbolType.Invalid); }