- #1
ChakanaX
- 6
- 0
< Mentor Note -- thread moved to HH from the technical physics forums, so no HH Template is shown >
I was given the following question to answer for my Automata class:
function =
if(condition) then
statement
else
statement
the gramma for this if-then-else is
S0 -> iCtSA (if <condition> then <statement> A)
A -> ;eS | ε (;else<statement>|ε)
1. please design an automata to simulate the compiler.
2. how to write a compiler program for if-then-else statement
What exactly does it mean when it says "write a compiler program for the if-then-else statement?" I designed an automata/state machine simulating the basic if then else format for part 1, but is it asking for an arbitrary if then else programming example of my own choosing( like any kind of if statement example) or a code simulation of the automata I created for part 1? Forgive me if my question seems very basic, I'm very new to Automata theory
I was given the following question to answer for my Automata class:
function =
if(condition) then
statement
else
statement
the gramma for this if-then-else is
S0 -> iCtSA (if <condition> then <statement> A)
A -> ;eS | ε (;else<statement>|ε)
1. please design an automata to simulate the compiler.
2. how to write a compiler program for if-then-else statement
What exactly does it mean when it says "write a compiler program for the if-then-else statement?" I designed an automata/state machine simulating the basic if then else format for part 1, but is it asking for an arbitrary if then else programming example of my own choosing( like any kind of if statement example) or a code simulation of the automata I created for part 1? Forgive me if my question seems very basic, I'm very new to Automata theory
Last edited by a moderator: