~nbrinza/zorba/parse-fragment

« back to all changes in this revision

Viewing changes to src/compiler/parser/xquery_driver.cpp

  • Committer: nbrinza at gmail
  • Date: 2013-04-09 14:34:55 UTC
  • mfrom: (10477.1.877 zorba)
  • Revision ID: nbrinza@gmail.com-20130409143455-wofxpaysvqjci57p
Merged with Zorba trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#  pragma GCC diagnostic warning "-Wparentheses"
33
33
#endif
34
34
 
 
35
#include "compiler/parser/zorba_parser_error.h"
35
36
#include "compiler/api/compilercb.h"
36
37
#include "context/static_context.h"
37
38
#include "diagnostics/xquery_diagnostics.h"
38
39
#include "util/xml_util.h"
39
40
 
 
41
 
40
42
namespace zorba
41
43
{
42
44
 
43
 
ZorbaParserError::ZorbaParserError(std::string _msg, Error const &code)
44
 
  :
45
 
  msg(_msg), err_code(code)
46
 
{
47
 
}
48
 
 
49
 
ZorbaParserError::ZorbaParserError(std::string _msg, const location& aLoc, Error const &code)
50
 
  :
51
 
  msg(_msg), loc(xquery_driver::createQueryLocStatic(aLoc)), err_code(code)
52
 
{
53
 
}
54
 
 
55
 
ZorbaParserError::ZorbaParserError(std::string _msg, const QueryLoc& aLoc, Error const &code)
56
 
  :
57
 
  msg(_msg), loc(aLoc), err_code(code)
58
 
{
59
 
}
60
 
 
61
45
xquery_driver::xquery_driver(CompilerCB* aCompilerCB, uint32_t initial_heapsize)
62
46
  :
63
47
  symtab(initial_heapsize),
235
219
  return lLoc;
236
220
}
237
221
 
238
 
QueryLoc xquery_driver::createQueryLocStatic(const location& aLoc)
239
 
{
240
 
  QueryLoc lLoc;
241
 
  lLoc.setFilename(aLoc.begin.filename->c_str());
242
 
  lLoc.setLineBegin(aLoc.begin.line);
243
 
  lLoc.setColumnBegin(aLoc.begin.column);
244
 
  lLoc.setLineEnd(aLoc.end.line);
245
 
  lLoc.setColumnEnd(aLoc.end.column);
246
 
  return lLoc;
247
 
}
248
 
 
249
222
}       /* namespace zorba */
250
223
/* vim:set et sw=2 ts=2: */