Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
nsXFormsXPathParser Class Reference

The XPath Expression parser. More...

#include <nsXFormsXPathParser.h>

Collaboration diagram for nsXFormsXPathParser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsXFormsXPathParser ()
 ~nsXFormsXPathParser ()
nsXFormsXPathNodeParse (const nsAString &aExpression)
PRBool UsesDynamicFunc () const

Private Member Functions

nsXFormsXPathScanner::XPATHTOKEN PeekToken ()
nsXFormsXPathScanner::XPATHTOKEN PopToken ()
void PushContext (PRInt32 aStartIndex=-100)
void PushContext (nsXFormsXPathNode *mAnalyze)
void EndContext ()
void RestartContext ()
nsXFormsXPathNodeJustContext ()
nsXFormsXPathNodePopContext ()
PRBool DoRelative ()
void AbbreviatedStep ()
void AbsoluteLocationPath ()
void AdditiveExpression ()
void AndExpr ()
void AxisSpecifier ()
void EqualityExpr ()
void Expr ()
void FilterExpr ()
void FunctionCall ()
void LocationPath ()
void MultiplicationExpr ()
void NameTest ()
void NodeTest ()
void NodeType ()
void OrExpr ()
void PathExpr ()
void Predicate ()
PRBool PrimaryExpr ()
void RelationalExpression ()
void RelativeLocationPath ()
void Step ()
void UnaryExpr ()
void UnionExpr ()

Private Attributes

nsXFormsXPathScanner mScanner
nsXFormsXPathScanner::XPATHTOKEN mPeek
PRBool mUsesDynamicFunc
nsXFormsXPathNodemHead
int mAnalyzeStackPointer
int mPredicateLevel
nsXFormsXPathNodemStack [ANALYZE_STACK_SIZE]

Detailed Description

The XPath Expression parser.

Uses nsXFormsXPathScanner to scan the expression and builds a parse tree of nsXFormsXPathNode's.

Note:
Should be reimplemented and moved to Transformiix

Definition at line 52 of file nsXFormsXPathParser.h.


Constructor & Destructor Documentation

Definition at line 68 of file nsXFormsXPathParser.cpp.


Member Function Documentation

Definition at line 138 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 210 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 236 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 95 of file nsXFormsXPathParser.cpp.

{
  if (mHead) {
    mHead->mEndIndex = mScanner.Offset() + 1;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 314 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 339 of file nsXFormsXPathParser.cpp.

{
  OrExpr();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 345 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 353 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 115 of file nsXFormsXPathParser.cpp.

Here is the caller graph for this function:

Definition at line 396 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 419 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 439 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 454 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 475 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 510 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsXFormsXPathNode * nsXFormsXPathParser::Parse ( const nsAString &  aExpression)

Definition at line 854 of file nsXFormsXPathParser.cpp.

{
#ifdef DEBUG_XF_PARSER
  printf("=====================================\n");
  printf("Parsing: %s\n", NS_ConvertUTF16toUTF8(aExpression).get());
  printf("=====================================\n");
#endif

  mScanner.Init(aExpression);
  mAnalyzeStackPointer = 0;
  mPredicateLevel = 0;
  mHead = nsnull;
  PopToken();
  PushContext();
  
  nsXFormsXPathNode* root = mHead;
  Expr();
  PopContext();

#ifdef DEBUG_XF_PARSER
  Dump(root);
  printf("-------------------------------------\n");
#endif

  return root;
}

Here is the call graph for this function:

Definition at line 571 of file nsXFormsXPathParser.cpp.

{
  return mPeek;
}

Here is the caller graph for this function:

Definition at line 124 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 577 of file nsXFormsXPathParser.cpp.

{
  nsXFormsXPathScanner::XPATHTOKEN temp = mPeek;
  mPeek = mScanner.NextToken();
  if (mPeek == nsXFormsXPathScanner::WHITESPACE) { // Skip whitespaces
    mPeek = mScanner.NextToken();
  }
  NS_WARN_IF_FALSE(mPeek != nsXFormsXPathScanner::ERRORXPATHTOKEN,
                   "Scanner returned ERROR token!");
  return temp;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 591 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nsXFormsXPathParser::PushContext ( PRInt32  aStartIndex = -100) [private]

Definition at line 74 of file nsXFormsXPathParser.cpp.

{
  mHead = new nsXFormsXPathNode(mHead);
  if (aStartIndex == -100) {
    mHead->mStartIndex = mScanner.Offset() + 1;
  } else {
    mHead->mStartIndex = aStartIndex;
  }
  mStack[++mAnalyzeStackPointer] = mHead;
  mHead->mPredicate = mPredicateLevel != 0;
  mHead->mLiteral = PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 88 of file nsXFormsXPathParser.cpp.

{
  mStack[++mAnalyzeStackPointer] = aNode;
  mHead = aNode;
}

Definition at line 653 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 103 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 783 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 798 of file nsXFormsXPathParser.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 882 of file nsXFormsXPathParser.cpp.

                                           {
  return mUsesDynamicFunc;
}

Member Data Documentation

Definition at line 60 of file nsXFormsXPathParser.h.

Definition at line 59 of file nsXFormsXPathParser.h.

Definition at line 55 of file nsXFormsXPathParser.h.

Definition at line 61 of file nsXFormsXPathParser.h.

Definition at line 54 of file nsXFormsXPathParser.h.

Definition at line 62 of file nsXFormsXPathParser.h.

Definition at line 57 of file nsXFormsXPathParser.h.


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