General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
Tutorial on Name AnalysisJoined Ranges
In our language subtrees rooted by a However, there are situations where a range in the sense of the scope rules extends over several subtrees, but their common root can not be taken as the scope range. Such a situation occurs for example in Pascal, where the formal parameter list of a procedure and the procedure body form a single range.
The Join.con[15]== Statement: Join. Join: 'join' DefIdent JoinedBlock JoinedBlock 'joined' ';'. JoinedBlock: Compound. This macro is attached to a product file. We could modify the grammar in order to get a single symbol representing that range. But that may not be desirable due to parsing reasons. The problem is solved by the following technique:
A symbol, here
The symbol
The roles Join.specs[16]== $/Name/AlgRangeSeq.gnrc:inst This macro is attached to a product file. Join.lido[17]== RULE: Join ::= 'join' DefIdent JoinedBlock JoinedBlock 'joined' ';' END; SYMBOL Join INHERITS RangeSequence END; SYMBOL JoinedBlock INHERITS RangeElement END; This macro is attached to a product file.
|