CS110 Chapter Notes - Chapter 5: Finite-State Machine, Lexeme, Regular Expression

46 views10 pages

Document Summary

This document discusses details of finite state machine (fsm) and its applications: fsm is a virtual machine which can only be in exactly one state at a time. 3: main function, returns 1 if the c string represents a valid integer; otherwise 0, pseudocode: identical to case 1, application: If the current state is 1, return 2 if input is a negative sign, return 3 if input is a number, or return 4 if input is a colon; else return -1. If the current state is 2, return 3 if input is a number, or return 4 if input is a colon; else return -1. If the current state is 3, return 3 if input is a number or return 4 if input is a colon; else return -1. If the current state is 4, return 4 if input is a number; else return -1.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents