[antlr-interest] i faced problem with "sort" command?! anybody can help me? i have limited time :(

Reza reza.genial at gmail.com
Thu Feb 17 01:00:55 PST 2011


Dear All
      I'm using one framework they used ANTLR 2.7.3 (20050127-10) as part of
this framework but when i try to compile this part of frame work i receive
below error is there any boday can help me.
/* $ANTLR 2.7.3 (20050127-10): "XmlPL.g" -> "XmlPLParser.cpp"$ */ in these
two file there is sort command but when i compile i receive this error:
.
.
.
../../xmlpl/parser/ast/Cast.h: In member function ‘virtual const bool
Cast::isSelfAppending() const’:
../../xmlpl/parser/ast/Cast.h:35: warning: suggest parentheses around ‘&&’
within ‘||’
XmlPL.g: In member function ‘void XmlPLParser::program(const EnvRef&)’:
XmlPL.g:506: error: ‘sort’ was not declared in this scope
XmlPL.g:506: error: expected primary-expression before ‘,’ token
XmlPL.g:506: error: expected primary-expression before ‘>’ token
make[7]: *** [libxmlplParser_la-XmlPLParser.lo] Error 1
make[7]: Leaving directory
`/home/reza/daedalus/Tools/sesame-release_20071126/xmlpl/xmlplcc/src/xmlpl/parser'
make[6]: *** [all-recursive] Error 1
.
.
.

any body can help me to solve this problem and in below is that part of
source code used sort command:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
XmlPLParser.cpp :

#line 496 "XmlPL.g"

                vector<EnvEntryRef> entries;
                if (Options::getInstance()->getBuildLibrary()) {
                if (pd_AST == 0)
                ErrorHandler::error("libraries must have a package
declaration");

                // Get local symbols
                Environment::env_map_t::const_iterator it;
                for (it = env->begin(); it != env->end(); it++) {
                Environment::ns_map_t::const_iterator it2;
                it2 = it->second.find("");
                if (it2 == it->second.end()) continue;

                entries.push_back(it2->second);
                }

                Sort symbols
                sort<vector<EnvEntryRef>::iterator,
ltEnvEntry>(entries.begin(),
                              entries.end(), ltEnvEntry());
                }
//////////////////////////////////////////////////////////////////////////////////////////////////////////
XmlPL.g:

program[const EnvRef &env]
: (pd:packageDecl[env])? (declaration[env])* EOF!
{
  vector<EnvEntryRef> entries;
  if (Options::getInstance()->getBuildLibrary()) {
    if (#pd == 0)
      ErrorHandler::error("libraries must have a package declaration");

    // Get local symbols
    Environment::env_map_t::const_iterator it;
    for (it = env->begin(); it != env->end(); it++) {
      Environment::ns_map_t::const_iterator it2;
      it2 = it->second.find("");
      if (it2 == it->second.end()) continue;

      entries.push_back(it2->second);
    }

    Sort symbols
    sort<vector<EnvEntryRef>::iterator, ltEnvEntry>(entries.begin(),
                 entries.end(), ltEnvEntry());
  }

  Program *p = new Program(entries);
  #program = #(p, #program);
}
;
/////////////////////////////////////////////////////////////////////////////////////////////////
-- 
Best Regards
Reza


More information about the antlr-interest mailing list