Example #1
0
 static FunctionParser()
 {
     FirstFunction     = new TokenSet(TokenType.Sine | TokenType.Cosine | TokenType.Tangent);
     FirstFactor       = FirstFunction + new TokenSet(TokenType.Variable | TokenType.OpenParen);
     FirstFactorPrefix = FirstFactor + TokenType.Constant;
     FirstUnaryExp     = FirstFactorPrefix + TokenType.Minus;
     FirstExpExp       = new TokenSet(FirstUnaryExp);
     FirstMultExp      = new TokenSet(FirstUnaryExp);
     FirstAddExp       = new TokenSet(FirstUnaryExp);
 }
Example #2
0
 /// <summary>
 /// Check if the CurrentToken is a member of a set Token types
 /// </summary>
 /// <param name="tokens">The set of Token types to check against</param>
 /// <returns>
 /// true if the CurrentToken's type is in the set
 /// false if it is not
 /// </returns>
 private static bool Check(TokenSet tokens)
 {
     return(tokens.Contains(CurrentToken.type));
 }
Example #3
0
 public TokenSet(TokenSet t)
 {
     this.tokens = t.tokens;
 }