Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a255a7bbaa38b1bb

Jump to content

S-attributed grammar

From Wikipedia, the free encyclopedia

In formal language S-attributed grammars are a class of attribute grammars characterized by having no inherited attributes, but only synthesized 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.

Specifications for parser generators in the Yacc family can be broadly considered S-attributed grammars. However, these parser generators usually include the capacity to reference global variables and/or fields from within any given grammar rule, meaning that this is not a pure S-attributed approach.

Any S-attributed grammar is also an L-attributed grammar.[1]

References

[edit]
  1. Wilhelm, Reinhard; Seidl, Helmut; Hack, Sebastian (2013-05-13). Compiler Design: Syntactic and Semantic Analysis. Springer Science & Business Media. ISBN 978-3-642-17540-4. Retrieved 2025-07-22.

See also

[edit]