private void Operator_Letter(IRuntime runtime, int myId, Message message) { // item 415 CreateOperator(Data); // item 408 AddChar(Data, message.C); // item 411 CurrentState = StateNames.Identifier; }
private void Operator_Digit(IRuntime runtime, int myId, Message message) { // item 416 CreateOperator(Data); // item 409 AddChar(Data, message.C); // item 412 CurrentState = StateNames.Number; }
private void Number_dummy(IRuntime runtime, int myId, Message message) { // item 396 CurrentState = StateNames.Operator; }
private void Operator_Whitespace(IRuntime runtime, int myId, Message message) { // item 414 CreateOperator(Data); // item 341 CurrentState = StateNames.Idle; }
private void Number_Digit(IRuntime runtime, int myId, Message message) { // item 392 AddChar(Data, message.C); // item 395 CurrentState = StateNames.Number; }
private void Number_Operator(IRuntime runtime, int myId, Message message) { // item 398 CreateNumber(Data); // item 393 AddChar(Data, message.C); // item 396 CurrentState = StateNames.Operator; }
private void Number_Whitespace(IRuntime runtime, int myId, Message message) { // item 397 CreateNumber(Data); // item 349 CurrentState = StateNames.Idle; }
private void Idle_Whitespace(IRuntime runtime, int myId, Message message) { // item 338 CurrentState = StateNames.Idle; }
private void Identifier_Digit(IRuntime runtime, int myId, Message message) { // item 375 AddChar(Data, message.C); // item 378 CurrentState = StateNames.Identifier; }
private void Identifier_Operator(IRuntime runtime, int myId, Message message) { // item 381 CreateIdentifier(Data); // item 376 AddChar(Data, message.C); // item 379 CurrentState = StateNames.Operator; }
private void Identifier_Letter(IRuntime runtime, int myId, Message message) { // item 374 AddChar(Data, message.C); // item 377 CurrentState = StateNames.Identifier; }
private void Identifier_Whitespace(IRuntime runtime, int myId, Message message) { // item 380 CreateIdentifier(Data); // item 346 CurrentState = StateNames.Idle; }
private void Idle_Operator(IRuntime runtime, int myId, Message message) { // item 361 AddChar(Data, message.C); // item 364 CurrentState = StateNames.Operator; }
private void Operator_Operator(IRuntime runtime, int myId, Message message) { // item 417 if (TryMakeLongOperator(Data, message.C)) { // item 420 CurrentState = StateNames.Idle; } else { // item 421 CreateOperator(Data); // item 410 AddChar(Data, message.C); // item 413 CurrentState = StateNames.Operator; } }
private void Number_Letter(IRuntime runtime, int myId, Message message) { // item 391 AddChar(Data, message.C); // item 394 CurrentState = StateNames.Number; }
public static List<Token> LexWeak(string text) { IEnumerator<char> _it433 = null; char c = default(char); // item 432 Init(); var lexer = new LexerMachineWeak(); var runtime = new RuntimeStub(); int id = 0; // item 452 var msg = new Message(); // item 4330001 _it433 = ((IEnumerable<char>)text).GetEnumerator(); while (true) { // item 4330002 if (_it433.MoveNext()) { } else { break; } // item 4330004 c = _it433.Current; // item 453 msg.C = c; // item 437 if (c == '_') { // item 445 msg.Code = Letter; } else { // item 440 if (Char.IsLetter(c)) { // item 445 msg.Code = Letter; } else { // item 442 if (Char.IsDigit(c)) { // item 446 msg.Code = Digit; } else { // item 447 if (IsOperator(c)) { // item 450 msg.Code = Operator; } else { // item 451 msg.C = ' '; msg.Code = Whitespace; } } } } // item 454 lexer.OnMessage(runtime, id, msg); } // item 455 msg.C = ' '; msg.Code = Whitespace; lexer.OnMessage(runtime, id, msg); // item 435 return lexer.Tokens; }
public void OnMessage(IRuntime runtime, int myId, Message message) { switch (message.Code) { case Digit: switch (CurrentState) { case StateNames.Idle: Idle_Digit(runtime, myId, message); break; case StateNames.Identifier: Identifier_Digit(runtime, myId, message); break; case StateNames.Number: Number_Digit(runtime, myId, message); break; case StateNames.Operator: Operator_Digit(runtime, myId, message); break; default: break; } break; case Letter: switch (CurrentState) { case StateNames.Idle: Idle_Letter(runtime, myId, message); break; case StateNames.Identifier: Identifier_Letter(runtime, myId, message); break; case StateNames.Number: Number_Letter(runtime, myId, message); break; case StateNames.Operator: Operator_Letter(runtime, myId, message); break; default: break; } break; case Operator: switch (CurrentState) { case StateNames.Idle: Idle_Operator(runtime, myId, message); break; case StateNames.Identifier: Identifier_Operator(runtime, myId, message); break; case StateNames.Number: Number_Operator(runtime, myId, message); break; case StateNames.Operator: Operator_Operator(runtime, myId, message); break; default: break; } break; case Whitespace: switch (CurrentState) { case StateNames.Idle: Idle_Whitespace(runtime, myId, message); break; case StateNames.Identifier: Identifier_Whitespace(runtime, myId, message); break; case StateNames.Number: Number_Whitespace(runtime, myId, message); break; case StateNames.Operator: Operator_Whitespace(runtime, myId, message); break; default: break; } break; case dummy: switch (CurrentState) { case StateNames.Idle: break; case StateNames.Identifier: break; case StateNames.Number: Number_dummy(runtime, myId, message); break; case StateNames.Operator: break; default: break; } break; default: break; } }