coins.opt
Class GlobalReform.MatchingData

java.lang.Object
  extended bycoins.opt.GlobalReform.MatchingData
Enclosing class:
GlobalReform

protected class GlobalReform.MatchingData
extends java.lang.Object

The class MatchingData represents various matching insormation and provides methods to set/refer them.


Field Summary
 HIR expandedHir
           
 boolean madeComplete
           
 HIR matchedInput
           
 HIR matchedProduction
           
 java.util.Map nontermParamCorresp
           
 GlobalReform.NontermPatInstance nontermPat
           
 java.util.Map paramCorresp
           
 GlobalReform.MatchingData parentData
           
 boolean succeeded
           
 
Constructor Summary
GlobalReform.MatchingData(GlobalReform.NontermPatInstance pNontermPat, GlobalReform.MatchingData pParentData)
          Make an instance of MatchingData for the nonterminal or pattern pnontermPat inheriting information of the parent matchingData pParentData.
 
Method Summary
 GlobalReform.MatchingData getMatchingData(GlobalReform.NontermPatInstance pNontermInstance, HIR pCallExp)
          Get the instance of MatchingData that corresponds to the nonterminal call pCallExp (by refering fMatchingDataForNontermInstance).
 void recordMatchingData(GlobalReform.NontermPatInstance pNontermInstance, HIR pCallExp, GlobalReform.MatchingData pData)
          Record the matched input and the matching data (pData) corresponding to the call exp (pCallExp) of pNontermInstance.
 GlobalReform.MatchingData reflect(GlobalReform.MatchingData pData)
          For this MatchingData, set following information of pData: paramCorresp, nontermParamCorresp, matchedProduction, matchedInput, expandedHir, succeeded.
 GlobalReform.MatchingData reflectCorresp(GlobalReform.MatchingData pData)
          Reflect paramCorresp and nontermParamCorresp of pData
 GlobalReform.MatchingData reflectParamCorresp(GlobalReform.MatchingData pData)
          Reflect paramCorresp of pData (do not reflect nontermParamCorresp).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nontermPat

public GlobalReform.NontermPatInstance nontermPat

paramCorresp

public java.util.Map paramCorresp

nontermParamCorresp

public java.util.Map nontermParamCorresp

matchedProduction

public HIR matchedProduction

matchedInput

public HIR matchedInput

expandedHir

public HIR expandedHir

succeeded

public boolean succeeded

parentData

public GlobalReform.MatchingData parentData

madeComplete

public boolean madeComplete
Constructor Detail

GlobalReform.MatchingData

public GlobalReform.MatchingData(GlobalReform.NontermPatInstance pNontermPat,
                                 GlobalReform.MatchingData pParentData)
Make an instance of MatchingData for the nonterminal or pattern pnontermPat inheriting information of the parent matchingData pParentData. Inherited information: paramCorresp, nontermParamCorresp, matchedInput, succeeded, and if parent represent the same nonterminal or pattern, then matchedProduction and expandedHir.

Parameters:
pNontermPat - Instance of a nonterminal or pattern.
pParentData - Parent matching data to inherit.
Method Detail

reflect

public GlobalReform.MatchingData reflect(GlobalReform.MatchingData pData)
For this MatchingData, set following information of pData: paramCorresp, nontermParamCorresp, matchedProduction, matchedInput, expandedHir, succeeded.

Parameters:
pData - Matching data from which information is to be copied.
Returns:
Nwe instance of the matching data.

reflectCorresp

public GlobalReform.MatchingData reflectCorresp(GlobalReform.MatchingData pData)
Reflect paramCorresp and nontermParamCorresp of pData

Parameters:
pData - matching data to inherit.
Returns:
this matching data updated.

reflectParamCorresp

public GlobalReform.MatchingData reflectParamCorresp(GlobalReform.MatchingData pData)
Reflect paramCorresp of pData (do not reflect nontermParamCorresp).

Parameters:
pData - matching data to inherit.
Returns:
this matching data updated.

recordMatchingData

public void recordMatchingData(GlobalReform.NontermPatInstance pNontermInstance,
                               HIR pCallExp,
                               GlobalReform.MatchingData pData)
Record the matched input and the matching data (pData) corresponding to the call exp (pCallExp) of pNontermInstance. Use pCallExp itself as the key for fMatchingDataForNontermInstance. Use makeHirKey(pCallExp)as the key for fMatchingDataForNonterm. This also records pData as the last matching data for the nonterminal.

Parameters:
pNontermInstance - nonterminal instance corresponding to pCallExp.
pCallExp - expression calling pNonterminal.
pData - matching data corresponding to the call exp.

getMatchingData

public GlobalReform.MatchingData getMatchingData(GlobalReform.NontermPatInstance pNontermInstance,
                                                 HIR pCallExp)
Get the instance of MatchingData that corresponds to the nonterminal call pCallExp (by refering fMatchingDataForNontermInstance).

Parameters:
pNontermInstance -
pCallExp -
Returns:
the instance of matching data.