Logo Search packages:      
Sourcecode: maude version File versions  Download package

Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends

MixfixModule Class Reference

Inheritance diagram for MixfixModule:
Inheritance graph
[legend]
Collaboration diagram for MixfixModule:
Collaboration graph
[legend]

List of all members.

Classes

struct  BubbleSpec
struct  ColoringInfo
struct  IdHook
struct  OpHook
struct  Polymorph
struct  SymbolInfo
struct  TermHook

Public Types

typedef map< int, Sort * > AliasMap
enum  GatherSymbols { GATHER_e = -1, GATHER_E = 0, GATHER_AMP = 1 }
enum  ItemType { MEMB_AX = 0x10000000, EQUATION = 0x20000000, RULE = 0x30000000 }
enum  ModuleType { FUNCTIONAL_MODULE = 0, SYSTEM_MODULE = SYSTEM, FUNCTIONAL_THEORY = THEORY, SYSTEM_THEORY = SYSTEM | THEORY }
enum  Precedence {
  MIN_PREC = 0, MAX_PREC = 127, ANY = 127, PREFIX_PREC = 0,
  PREFIX_GATHER = 95, UNARY_PREC = 15, INFIX_PREC = 41, ASSIGNMENT_PREC = 75,
  STRAT_TEST_PREC = 93, STRAT_SEQ_PREC = 95, STRAT_UNION_PREC = 97, STRAT_ORELSE_PREC = 99,
  STRAT_BRANCH_PREC = 101
}
enum  Status {
  OPEN, SORT_SET_CLOSED, SIGNATURE_CLOSED, FIX_UPS_CLOSED,
  THEORY_CLOSED
}

Public Member Functions

int addBubbleSpec (Symbol *topSymbol, int lowerBound, int upperBound, int leftParenToken, int rightParenToken, const Vector< int > &excludedTokens)
void addIdentityToPolymorph (int polymorphIndex, Term *identity)
void addIdHookToPolymorph (int polymorphIndex, int purpose, const Vector< int > &data)
SymboladdOpDeclaration (Token prefixName, const Vector< Sort * > &domainAndRange, SymbolType symbolType, const Vector< int > &strategy, const NatSet &frozen, int prec, const Vector< int > &gather, const Vector< int > &format, int metadata, bool &firstDecl)
void addOpHookToPolymorph (int polymorphIndex, int purpose, Symbol *symbol)
int addPolymorph (Token prefixName, const Vector< Sort * > &domainAndRange, SymbolType symbolType, const Vector< int > &strategy, const NatSet &frozen, int prec, const Vector< int > &gather, const Vector< int > &format, int metadata)
SortaddSort (int name)
void addTermHookToPolymorph (int polymorphIndex, int purpose, Term *term)
void addVariableAlias (Token name, Sort *sort)
bool allSet (int activeFlags) const
void bufferPrint (Vector< int > &buffer, Term *term, int printFlags)
void clearFlags (int activeFlags)
void clearMemo ()
void clearProfile ()
virtual void closeFixUps ()
void closeSignature ()
virtual void closeSortSet ()
virtual void closeTheory ()
void copyBubbleSpec (Symbol *originalSymbol, Symbol *newSymbol)
void copyFixUpBubbleSpec (Symbol *originalSymbol, SymbolMap *map)
void copyFixUpPolymorph (int polymorphIndex, const MixfixModule *originalModule, int originalPolymorphIndex, SymbolMap *map)
void economize ()
FloatSymbolfindFloatSymbol (const ConnectedComponent *component) const
int findPolymorphIndex (int polymorphName, const Vector< Sort * > &domainAndRange) const
QuotedIdentifierSymbolfindQuotedIdentifierSymbol (const ConnectedComponent *component) const
SortfindSort (int name) const
StringSymbolfindStringSymbol (const ConnectedComponent *component) const
SymbolfindSymbol (int name, const Vector< ConnectedComponent * > &domainComponents, ConnectedComponent *rangeComponent)
void fixUpBubbleSpec (int bubbleSpecIndex, Symbol *qidSymbol, Symbol *nilQidListSymbol, Symbol *qidListSymbol)
const Vector
< ConnectedComponent * > & 
getConnectedComponents () const
void getDataAttachments (Symbol *symbol, const Vector< Sort * > &opDeclaration, Vector< const char * > &purposes, Vector< Vector< const char * > > &data) const
EnvironmentgetEnvironment ()
const Vector< Equation * > & getEquations () const
bool getFlag (int flag) const
const Vector< int > & getFormat (Symbol *symbol) const
void getGather (Symbol *symbol, Vector< int > &gather) const
int getLineNumber () const
MemoMapgetMemoMap ()
int getMetadata (ItemType itemType, const ModuleItem *item) const
int getMetadata (ModuleItem *symbol, int opDeclIndex) const
int getMinimumSubstitutionSize () const
ModuleType getModuleType () const
int getNrPolymorphs () const
void getParserStats (int &nrNonterminals, int &nrTerminals, int &nrProductions)
bool getPolymorphDataAttachment (int index, int nr, int &purpose, Vector< int > &items) const
const Vector< Sort * > & getPolymorphDomainAndRange (int index) const
const Vector< int > & getPolymorphFormat (int index) const
const NatSetgetPolymorphFrozen (int index) const
void getPolymorphGather (int index, Vector< int > &gather) const
TermgetPolymorphIdentity (int index) const
int getPolymorphMetadata (int index) const
Token getPolymorphName (int index) const
int getPolymorphPrec (int index) const
const Vector< int > & getPolymorphStrategy (int index) const
bool getPolymorphSymbolAttachment (int index, int nr, int &purpose, Symbol *&op) const
bool getPolymorphTermAttachment (int index, int nr, int &purpose, Term *&term) const
SymbolType getPolymorphType (int index) const
int getPrec (Symbol *symbol) const
const PrintAttributegetPrintAttribute (ItemType itemType, const ModuleItem *item) const
const Vector< Rule * > & getRules () const
const SortBddsgetSortBdds ()
const Vector< SortConstraint * > & getSortConstraints () const
const Vector< Sort * > & getSorts () const
Status getStatus () const
void getSymbolAttachments (Symbol *symbol, Vector< const char * > &purposes, Vector< Symbol * > &symbols) const
const Vector< Symbol * > & getSymbols () const
SymbolType getSymbolType (Symbol *symbol) const
void getTermAttachments (Symbol *symbol, Vector< const char * > &purposes, Vector< Term * > &terms) const
const AliasMap & getVariableAliases () const
int id () const
void insertEquation (Equation *equation)
void insertLateSymbol (Symbol *s)
void insertMetadata (ModuleItem *symbol, int opDeclIndex, int metadata)
void insertMetadata (ItemType itemType, const ModuleItem *item, int metadata)
void insertPotentialLabels (const set< int > &l)
void insertPrintAttribute (ItemType itemType, const PreEquation *statement, const Vector< int > &names, const Vector< Sort * > &sorts)
void insertRule (Rule *rule)
void insertSort (Sort *sort)
void insertSortConstraint (SortConstraint *sortConstraint)
void insertSymbol (Symbol *symbol)
SymbolinstantiatePolymorph (int polymorphIndex, int kindIndex)
SymbolinstantiateSortTest (Sort *sort, bool eager)
SymbolinstantiateVariable (Sort *sort)
bool isBad () const
bool isTheory () const
TermmakeBubble (int bubbleSpecIndex, const Vector< Token > &tokens, int first, int last)
TermmakeTrueTerm ()
void markAsBad ()
 MixfixModule (int name, ModuleType moduleType)
void notifySubstitutionSize (int minimumSize)
bool oneOrMoreSet (int activeFlags) const
bool parseMatchCommand (const Vector< Token > &bubble, Term *&pattern, Term *&subject, Vector< ConditionFragment * > &condition)
bool parseSearchCommand (const Vector< Token > &bubble, Term *&initial, int &searchType, Term *&target, Vector< ConditionFragment * > &condition)
void parseStatement (const Vector< Token > &bubble)
bool parseStrategyCommand (const Vector< Token > &bubble, Term *&subject, StrategyExpression *&strategy)
TermparseTerm (const Vector< Token > &bubble, ConnectedComponent *component=0, int begin=0, int end=DEFAULT)
int parseTerm2 (const Vector< Token > &bubble, ConnectedComponent *component, Term *&parse1, Term *&parse2, int &firstBad)
bool parseUnifyCommand (const Vector< Token > &bubble, Vector< Term * > &lhs, Vector< Term * > &rhs)
void printAttributes (ostream &s, const PreEquation *pe, ItemType itemType)
void profileEqConditionStart (const Equation *eq)
void profileEqRewrite (DagNode *redex, const Equation *eq, int type)
void profileFragment (const PreEquation *preEquation, int fragmentIndex, bool success)
void profileMbConditionStart (const SortConstraint *mb)
void profileMbRewrite (DagNode *redex, const SortConstraint *mb)
void profileRlConditionStart (const Rule *rl)
void profileRlRewrite (DagNode *redex, const Rule *rl)
virtual void reset ()
void resetRules ()
void restoreHiddenState ()
void saveHiddenState ()
void setFlags (int activeFlags)
void setLineNumber (int lineNr)
void showProfile (ostream &s) const

Static Public Member Functions

static bool canHaveAsParameter (ModuleType t1, ModuleType t2)
static bool canImport (ModuleType t1, ModuleType t2)
static SortdisambiguatorSort (const Term *term)
static SorthookSort (Sort *sort)
static bool isTheory (ModuleType t)
static ModuleType join (ModuleType t1, ModuleType t2)
static const char * moduleEndString (ModuleType type)
static const char * moduleTypeString (ModuleType type)
static void printCondition (ostream &s, const Vector< ConditionFragment * > &condition)
static void printCondition (ostream &s, const PreEquation *pe)

Static Protected Member Functions

static int findMatchingParen (const Vector< Token > &tokens, int pos)

Private Types

enum  Bits { SYSTEM = 1, THEORY = 2 }
enum  DagNodeStatus { CONSTRUCTOR = 1, STRANGENESS_BELOW = 2 }
enum  InternalFlags {
  LEFT_BARE = 0x1, RIGHT_BARE = 0x2, ADHOC_OVERLOADED = 0x4, DOMAIN_OVERLOADED = 0x8,
  RANGE_OVERLOADED = 0x10, PSEUDO_STRING = 0x40, PSEUDO_QUOTED_IDENTIFIER = 0x80, PSEUDO_FLOAT = 0x100,
  PSEUDO_VARIABLE = 0x200, PSEUDO_NAT = 0x1000, PSEUDO_NEG = 0x2000, PSEUDO_RAT = 0x4000,
  PSEUDOS
}
typedef map< int, int > IntMap
enum  NonTerminal {
  TERM = -1, SMALL_NAT = -2, SMALL_NEG = -3, QUOTED_ID = -4,
  STRING_NT = -5, FLOAT_NT = -6, ENDS_IN_COLON_NT = -7, COLON_PAIR = -8,
  COLON2_PAIR = -9, COLON3_PAIR = -10, EQUALITY_PAIR = -11, ARROW_PAIR = -12,
  ASSIGN_PAIR = -13, LABEL = -14, CONDITION_FRAGMENT = -15, RULE_CONDITION_FRAGMENT = -16,
  CONDITION = -17, RULE_CONDITION = -18, MB_BODY = -19, EQ_BODY = -20,
  RL_BODY = -21, STATEMENT_PART = -22, ATTRIBUTE_PART = -23, ATTRIBUTE_LIST = -24,
  ATTRIBUTE = -25, STATEMENT = -26, ZERO = -27, RATIONAL = -28,
  VARIABLE = -29, PRINT_ITEM = -30, PRINT_LIST = -31, SIMPLE_BASE = -32,
  SEARCH_CONNECTIVE = SIMPLE_BASE, MATCH_PAIR = SIMPLE_BASE - 1, SEARCH_PAIR = SIMPLE_BASE - 2, SUCH_THAT = SIMPLE_BASE - 3,
  STRATEGY_EXPRESSION = SIMPLE_BASE - 4, MATCH_COMMAND = SIMPLE_BASE - 5, SEARCH_COMMAND = SIMPLE_BASE - 6, STRATEGY_COMMAND = SIMPLE_BASE - 7,
  ASSIGNMENT = SIMPLE_BASE - 8, SUBSTITUTION = SIMPLE_BASE - 9, STRATEGY_LIST = SIMPLE_BASE - 10, UNIFY_PAIR = SIMPLE_BASE - 11,
  UNIFY_COMMAND = SIMPLE_BASE - 12, COMPLEX_BASE = SIMPLE_BASE - 13
}
enum  NonTerminalType {
  NUMBER_OF_TYPES = 5, TERM_TYPE = 0, SORT_TYPE = 1, DOT_SORT_TYPE = 2,
  ASSOC_LIST_TYPE = 3, SORT_LIST_TYPE = 4
}
typedef map< int, Sort * > SortMap

Private Member Functions

bool ambiguous (int iflags)
const char * computeColor (ColoringInfo &coloringInfo, DagNode *dagNode)
void computePrecAndGather (int nrArgs, SymbolInfo &si, Symbol *symbol=0)
int findBubbleSpecIndex (Symbol *topSymbol) const
void graphPrint (ostream &s, DagNode *dagNode)
bool handleDivision (Vector< int > &buffer, Term *term, SymbolInfo &si, int printFlags)
bool handleDivision (ostream &s, DagNode *dagNode, bool rangeKnown, const char *color)
bool handleDivision (ostream &s, Term *term, bool rangeKnown, const char *color)
void handleFloat (ostream &s, DagNode *dagNode, bool rangeKnown, const char *color)
void handleFloat (ostream &s, Term *term, bool rangeKnown, const char *color)
void handleFormat (Vector< int > &buffer, int spaceToken)
bool handleIter (ostream &s, ColoringInfo &coloringInfo, DagNode *dagNode, SymbolInfo &si, bool rangeKnown, const char *color)
bool handleIter (Vector< int > &buffer, Term *term, SymbolInfo &si, bool rangeKnown, int printFlags)
bool handleIter (ostream &s, Term *term, SymbolInfo &si, bool rangeKnown, const char *color)
bool handleMinus (ostream &s, DagNode *dagNode, bool rangeKnown, const char *color)
bool handleMinus (ostream &s, Term *term, bool rangeKnown, const char *color)
bool handleMinus (Vector< int > &buffer, Term *term, SymbolInfo &si, int printFlags)
void handleQuotedIdentifier (ostream &s, DagNode *dagNode, bool rangeKnown, const char *color)
void handleQuotedIdentifier (ostream &s, Term *term, bool rangeKnown, const char *color)
void handleString (ostream &s, Term *term, bool rangeKnown, const char *color)
void handleString (ostream &s, DagNode *dagNode, bool rangeKnown, const char *color)
void handleVariable (ostream &s, DagNode *dagNode, bool rangeKnown, const char *color)
void handleVariable (ostream &s, Term *term, bool rangeKnown, const char *color)
void makeAttributeProductions ()
void makeBoolProductions ()
void makeBubbleProductions ()
void makeCommand (int node, Vector< Term * > &terms)
void makeComplexProductions ()
void makeComponentProductions ()
void makeCondition (int node, Vector< ConditionFragment * > &condition)
ConditionFragmentmakeConditionFragment (int node)
void makeConditionProductions ()
void makeGrammar (bool complexFlag=false)
void makeLabelProductions ()
void makeParameterizedSortProductions ()
void makePolymorphProductions ()
void makeSpecialProductions ()
void makeStatement (int node)
void makeStatementProductions ()
void makeStrategyLanguageProductions ()
void makeSymbolProductions ()
TermmakeTerm (int node)
void makeVariableProductions ()
SymbolnewFancySymbol (Token prefixName, const Vector< Sort * > &domainAndRange, SymbolType symbolType, const Vector< int > &strategy)
int newNonTerminal ()
 NO_COPYING (MixfixModule)
int nonTerminal (const Sort *sort, NonTerminalType type)
int nonTerminal (int componentIndex, NonTerminalType type)
int parseSentence (const Vector< Token > &bubble, int root, int begin=0, int end=DEFAULT)
int parseSentence2 (const Vector< Token > &bubble, int root, int &firstBad, int begin, int nrTokens)
void prettyPrint (Vector< int > &buffer, Term *term, int requiredPrec, int leftCapture, const ConnectedComponent *leftCaptureComponent, int rightCapture, const ConnectedComponent *rightCaptureComponent, bool rangeKnown, int printFlags)
void prettyPrint (ostream &s, ColoringInfo &coloringInfo, DagNode *dagNode, int requiredPrec, int leftCapture, const ConnectedComponent *leftCaptureComponent, int rightCapture, const ConnectedComponent *rightCaptureComponent, bool rangeKnown)
void prettyPrint (ostream &s, Term *term, int requiredPrec, int leftCapture, const ConnectedComponent *leftCaptureComponent, int rightCapture, const ConnectedComponent *rightCaptureComponent, bool rangeKnown)
void printPrefixName (Vector< int > &buffer, int prefixName, SymbolInfo &si, int printFlags)
void printTails (Vector< int > &buffer, const SymbolInfo &si, int pos, int nrTails, bool needAssocParen, int printFlags)
int printTokens (Vector< int > &buffer, const SymbolInfo &si, int pos, int printFlags)
void printVariable (ostream &s, int name, Sort *sort) const

Static Private Member Functions

static int chooseDisambiguator (Symbol *s)
static const char * computeColor (SymbolType st)
static int computeGraphStatus (DagNode *dagNode, PointerSet &visited, Vector< int > &statusVec)
static bool domainAndRangeMatch (const Vector< Sort * > &domainAndRange1, const Vector< Sort * > &domainAndRange2)
static int domainComponentIndex (const Symbol *symbol, int argNr)
static bool fancySpace (ostream &s, int spaceToken)
static void graphCount (DagNode *dagNode, PointerSet &visited, Vector< mpz_class > &counts)
static void handleVariable (Vector< int > &buffer, Term *term, int printFlags)
static bool hasSameDomain (const Vector< Sort * > &domainAndRange1, bool assoc1, const Vector< Sort * > &domainAndRange2, bool assoc2)
static void makeIterName (string &name, int id, const mpz_class &number)
static int mayAssoc (Symbol *symbol, int argNr)
static void prefix (ostream &s, bool needDisambig, const char *color)
static bool prettyPrint (ostream &s, StrategyExpression *strategy, int requiredPrec)
static void printDotSort (Vector< int > &buffer, const Sort *sort, int printFlags)
static void printKind (Vector< int > &buffer, const Sort *kind, int printFlags)
static void printPrefixName (ostream &s, const char *prefixName, SymbolInfo &si)
static void printSort (Vector< int > &buffer, const Sort *sort, int printFlags)
static void printTails (ostream &s, const SymbolInfo &si, int pos, int nrTails, bool needAssocParen, bool checkForInterrupt=false, const char *color=0)
static int printTokens (ostream &s, const SymbolInfo &si, int pos, const char *color=0)
static void printVarSort (Vector< int > &buffer, string &fullName, const Sort *sort, int printFlags)
static void suffix (ostream &s, DagNode *dagNode, bool needDisambig, const char *color)
static void suffix (ostream &s, Term *term, bool needDisambig, const char *color)

Private Attributes

SortboolSort
set< int > bubbleComponents
Vector< BubbleSpecbubbleSpecs
bool complexParser
int componentNonTerminalBase
Vector< Symbol * > eagerSortTests
FreeSymbolfalseSymbol
IntMap firstSymbols
map< int, Symbol * > floatSymbols
IntMap iterSymbols
set< int > kindsWithDivision
set< int > kindsWithMinus
set< int > kindsWithSucc
Vector< Symbol * > lazySortTests
IntMap leadTokens
NatSet messageSymbols
ModuleType moduleType
int nextNonTerminal
NatSet objectSymbols
set< double > overloadedFloats
set< mpz_class > overloadedIntegers
set< int > overloadedQuotedIdentifiers
set< pair< mpz_class, mpz_class > > overloadedRationals
set< string > overloadedStrings
set< pair< int, int > > overloadedVariables
MixfixParserparser
Vector< Polymorphpolymorphs
set< int > potentialLabels
map< int, Symbol * > quotedIdentifierSymbols
SortMap sortNames
map< int, Symbol * > stringSymbols
Vector< SymbolInfosymbolInfo
FreeSymboltrueSymbol
AliasMap variableAliases
Vector< Symbol * > variableBase

Static Private Attributes

static bool attributeUsed = false
static Vector< int > emptyGather
static Vector< int > gatherAny
static Vector< int > gatherAny0
static Vector< int > gatherAnyAny
static Vector< int > gatherAnyAnyAny
static Vector< int > gatherPrefix
static Vector< int > gatherPrefixPrefix
static int globalIndent = 0

Friends

ostream & operator<< (ostream &s, const Term *term)
ostream & operator<< (ostream &s, StrategyExpression *strategy)
ostream & operator<< (ostream &s, DagNode *dagNode)

Detailed Description

Definition at line 40 of file mixfixModule.hh.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index