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+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents