Hi all,

I'm quite new at this and I'm trying to wrap my head around how to construct a semantic parse tree. Please bare with me since I have never taken a compiler class or similar.

According to the semantic manual the parse tree is a tree of semantic tags. What I don't understand is how I would go about constructing tags that have children. For example, I'm working with the Erlang language right now. I have bovine grammar with the rule (I'm aware the rule is in no way complete or probably even correct, I'm still just trying to understand how things work):

function-clause
  : function-name LPAREN arguments RPAREN ARROW body PERIOD
    (FUNCTION-TAG $1 'function $3)

What do I do with the body ($6)? How do I get it parsed and included in the parse tree?

Also, I would like to ask if there's any way of ensuring that buffer lexing is done at the correct depth so that the token stream is complete and contains no semantic-list's.

Thank you!