Exemplo n.º 1
0
 public void AppendTokenList(
     String delim, ArrayList<KToken> TokenList, int BeginIdx, int EndIdx, int ParseOption) {
   assert (this.NodeList.size() == 1);
   int start = BeginIdx;
   for (int i = BeginIdx; i < EndIdx; i++) {
     KToken Token = TokenList.get(i);
     if (Token.EqualsText(delim)) {
       AddParsedNode(ParseNewNode2(NodeNameSpace, null, TokenList, start, i, ParseOption));
       start = i + 1;
     }
   }
   if (start < EndIdx) {
     AddParsedNode(ParseNewNode2(NodeNameSpace, null, TokenList, start, EndIdx, ParseOption));
   }
 }
Exemplo n.º 2
0
 public int MatchKeyword(
     int Index,
     String Symbol,
     ArrayList<KToken> TokenList,
     int BeginIdx,
     int EndIdx,
     int ParseOption) {
   if (BeginIdx == -1) return -1;
   if (BeginIdx < EndIdx) {
     KToken Token = TokenList.get(BeginIdx);
     if (Token.EqualsText(Symbol)) {
       SetAt(Index, Token);
       return BeginIdx + 1;
     }
   }
   return ReportExpectedAfter(TokenList, BeginIdx, EndIdx, Symbol, ParseOption);
 }