Abstract Syntax

ab-stract: disassociated from any specific instance

Webster's Dictionary

OVERVIEW

A compiler must do more than recognize whether a sentence belongs to the language of a grammar - it must do something useful with that sentence. The semantic actions of a parser can do useful things with the phrases that are parsed.

In a recursive-descent parser, semantic action code is interspersed with the control flow of the parsing actions. In a parser specified in JavaCC, semantic actions are fragments of Java program code attached to grammar productions. SableCC, on the other hand, automatically generates syntax trees as it parses.