If I were to create a pushdown automation that accepts a state(name) and those states accept transitions(input, pop, push, nextState). How does all this help me construct a parse tree?
I mean a pushdown automata is great for checking if something is in the language, like if a sequence of tokens or whatever is in the correct order... but syntax trees?
I mean consider the following example:
Foo {
Woo {
Hello World
}
}
The pda can only remember the top item in a stack and the current input. How am I supposed to construct the tree? Should I combine PDA with recursion?