int x = 5; float y = "hello; String @z = "9.5"; int x = cse340; if ( x > 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; ); y = 13.45.0; int me = 99999000001111222000000111111222223443483045830948; while { x != 9} (); int {x} = 10;
int x = 5; float y = "hello; String@z="9.5”;intx=cse340;if(x> 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; );y = 13.45.0;int me =99999000001111222000000111111222 223443483045830948;while { x != 9} ();int {x} = 10; "hello "world" bye" # of STRINGS ? ? ? ? ? ? ? ? ?
int x = 5; float y = "hello; String@z="9.5”;intx=cse340;if(x> 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; );y = 13.45.0;int me =99999000001111222000000111111222 223443483045830948;while { x != 9} ();int {x} = 10; ”hello "world" bye" # of STRINGS 9 12 3 18 12 2 6 12 3
| Steps a) Read a text FILE line by line b) For each LINE: § Read character by character. § Create sets of consecutive characters (STRING). Try to group the bigger amount of characters as possible. § Start a new set each time that you need. Take care of: Whitespace, Delimiter, Operator, End of Line and others special characters. c) For each STRING: verify if it is a valid WORD. d) Create a VECTOR and store the STRINGs and WORDs.
Automata § It is a finite state machine that accepts/rejects finite strings of symbols and produces a unique result for each input string. § In the automaton, there are three states (denoted graphically by circles) and transition arrows connecting one state with other. § Upon reading a symbol, a DFA jumps deterministically from a state to another by following the transition arrow.
slides can only be used as study material for the Compilers course at Universidad Panamericana. They cannot be distributed or used for another purpose.