Exemple #1
0
 internal static bool IsPrimary(this XSharpToken token)
 {
     if (token.IsName())
     {
         return(true);
     }
     if (token.IsLiteral())
     {
         return(true);
     }
     return(false);
 }
Exemple #2
0
        internal static bool CanJoin(this XSharpToken token, XSharpToken nextToken)
        {
            if (token == null)
            {
                return(nextToken.IsName() || nextToken.IsLiteral() || nextToken.IsPrefix());
            }
            if (token.IsPrefix() || token.IsBinary())          // we allow .and. .not. and even .not. .not.
            {
                return(nextToken.IsPrimaryOrPrefix());
            }
            if (nextToken.IsBinary() || nextToken.NeedsLeft() || nextToken.IsPostFix())
            {
                return(token.IsPrimary() || token.IsClose());
            }

            return(false);
        }