コード例 #1
0
ファイル: Frame.cs プロジェクト: thecocce/multipascal
 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
ファイル: Alternator.cs プロジェクト: joewhite/dgrok
 public void AddToken(ITokenSet tokenSet)
 {
     _alternates.Add(new TokenSetAlternate(tokenSet));
 }
コード例 #7
0
ファイル: Alternator.cs プロジェクト: joewhite/dgrok
 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
ファイル: Frame.cs プロジェクト: thecocce/multipascal
 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));
 }