예제 #1
0
 public Token ParseToken(ITokenSet tokenSet)
 {
     if (CanParseToken(tokenSet))
     {
         return(Token);
     }
     throw new ParseException("Expected " + tokenSet.Name + " but found " + Token.Type, Location);
 }
예제 #2
0
파일: EofFrame.cs 프로젝트: Turbo87/DGrok
 public Token ParseToken(ITokenSet tokenSet)
 {
     throw new ParseException("Expected " + tokenSet.Name + " but found end of file", Location);
 }
예제 #3
0
파일: EofFrame.cs 프로젝트: Turbo87/DGrok
 public bool CanParseToken(ITokenSet tokenSet)
 {
     return false;
 }
예제 #4
0
파일: Frame.cs 프로젝트: DvdKhl/dgrok
 public Token ParseToken(ITokenSet tokenSet)
 {
     if(CanParseToken(tokenSet))
         return Token;
     throw new ParseException("Expected " + tokenSet.Name + " but found " + Token.Type, Location);
 }
예제 #5
0
파일: Frame.cs 프로젝트: DvdKhl/dgrok
 public bool CanParseToken(ITokenSet tokenSet)
 {
     return tokenSet.Contains(Token.Type);
 }
예제 #6
0
 public void AddToken(ITokenSet tokenSet)
 {
     _alternates.Add(new TokenSetAlternate(tokenSet));
 }
예제 #7
0
 public TokenSetAlternate(ITokenSet tokenSet)
 {
     _tokenSet = tokenSet;
 }
예제 #8
0
파일: EofFrame.cs 프로젝트: DvdKhl/dgrok
 public Token ParseToken(ITokenSet tokenSet)
 {
     throw new ParseException("Expected " + tokenSet.Name + " but found end of file", Location);
 }
예제 #9
0
파일: EofFrame.cs 프로젝트: DvdKhl/dgrok
 public bool CanParseToken(ITokenSet tokenSet)
 {
     return(false);
 }
예제 #10
0
 public bool CanParseToken(ITokenSet tokenSet)
 {
     return(tokenSet.Contains(Token.Type));
 }
예제 #11
0
 /// <summary>
 /// Returns true if the given <paramref name="transferPermissionTokenSet"/> is non-null and it contains the given key (token)
 /// </summary>
 public static bool GetIsTransferPermitted(this ITokenSet <string> transferPermissionTokenSet, string key)
 {
     return(transferPermissionTokenSet.SafeContains(key));
 }
예제 #12
0
 public TokenSetAlternate(ITokenSet tokenSet)
 {
     _tokenSet = tokenSet;
 }
예제 #13
0
 public void AddToken(ITokenSet tokenSet)
 {
     _alternates.Add(new TokenSetAlternate(tokenSet));
 }