Generic Interpreter 1.0
Private API

gi
Class ERE$5

java.lang.Object
  |
  +--gi.Grammar.Semantics
        |
        +--gi.ERE$5

synchronized class ERE$5
extends Grammar.Semantics


Constructor Summary
(package private) ERE$5(ERE)
           
 
Method Summary
protected  void evaluate(Grammar.ParseTree)
          Evaluates attributes in a ParseTree when interpreting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERE$5

ERE$5(ERE)
Method Detail

evaluate

protected void evaluate(Grammar.ParseTree)
Description copied from class: Grammar.Semantics

Evaluates attributes in a ParseTree when interpreting. evaluate is invoked when a production containing this Semantics is applied to the ParseTree. tree provides the context in which attribute evaluation occurs. tree.symbol and tree.phrase are the left- and right-hand side of the production in which this Semantics is embedded.

During top-down LL(1) parsing, the ParseTree is constructed from the top down by leftmost derivation. This is a depth-first left-to-right traversal, in which embedded Semantics are evaluated when first visited. Evaluation should not depend on attributes produced by Semantics below or to the right of this Semantics. In other words, LL parsing supports evaluation of L-attributed semantic specifications.

During bottom-up LR(0), SLR(1) or LR(1) parsing, the ParseTree is constructed from the bottom up by reverse rightmost derivation. Embedded Semantics are evaluated after all subtrees rooted in the phrase to be reduced have been visited.

Overrides:
evaluate in class Grammar.Semantics
Parameters:
- the ParseTree in which attribute evaluation occurs.

 

© 1999-2000 Craig A. Rich <carich@acm.org>