S-attributed grammar: Difference between revisions
Appearance
Content deleted Content added
m Disambiguate Semantic analysis to Semantic analysis (computer science) using popups |
Wherethere (talk | contribs) better way of linking s-attributed to l-attributed |
||
Line 1: | Line 1: | ||
'''S-attributed grammars''' are a class of [[attribute grammar]]s |
'''S-attributed grammars''' are a class of [[attribute grammar]]s characterized by having no inherited attributes. Inherited attributes, which must be passed down from parent nodes to children nodes of the [[abstract syntax tree]] during the [[Semantic analysis (computer science)|semantic analysis]] of the [[parsing]] process, are a problem for [[bottom-up parsing]] because in bottom-up parsing, the parent nodes of the abstract syntax tree are created ''after'' creation of all of their children. Attribute evaluation in S-attributed grammars can be incorporated conveniently in both [[top-down parsing]] and [[bottom-up parsing]]. yacc is based on the S-attributed approach. |
||
Any S-attributed grammar is also an [[L-attributed grammar]] |
|||
[[Category:Formal languages]] |
[[Category:Formal languages]] |
Revision as of 00:03, 11 January 2008
S-attributed grammars are a class of attribute grammars characterized by having no inherited attributes. Inherited attributes, which must be passed down from parent nodes to children nodes of the abstract syntax tree during the semantic analysis of the parsing process, are a problem for bottom-up parsing because in bottom-up parsing, the parent nodes of the abstract syntax tree are created after creation of all of their children. Attribute evaluation in S-attributed grammars can be incorporated conveniently in both top-down parsing and bottom-up parsing. yacc is based on the S-attributed approach.
Any S-attributed grammar is also an L-attributed grammar