Example #1
0
 public MayBeKeywordOrNameToken(string content, int lineIndex) : base(content, WhiteSpaceBehaviourOptions.Disallow, lineIndex)
 {
     if (!AtomToken.isContextDependentKeyword(content))
     {
         throw new ArgumentException("Invalid content for a MayBeKeywordOrNameToken");
     }
 }
 /// <summary>
 /// This inherits from AtomToken since a lot of processing would consider them the
 /// same token type while parsing the original content.
 /// </summary>
 public BuiltInFunctionToken(string content, int lineIndex) : base(content, WhiteSpaceBehaviourOptions.Disallow, lineIndex)
 {
     // Do all this validation (again) here in case this constructor wasn't called by the AtomToken.GetNewToken method
     if (string.IsNullOrWhiteSpace(content))
     {
         throw new ArgumentException("Null/blank content specified");
     }
     if (!AtomToken.isVBScriptFunction(content))
     {
         throw new ArgumentException("Invalid content specified - not a VBScript function");
     }
 }
Example #3
0
 /// <summary>
 /// This inherits from AtomToken since a lot of processing would consider them the
 /// same token type while parsing the original content.
 /// </summary>
 public KeyWordToken(string content, int lineIndex) : base(content, WhiteSpaceBehaviourOptions.Disallow, lineIndex)
 {
     // Do all this validation (again) here in case this constructor wasn't called by the AtomToken.GetNewToken method
     if (string.IsNullOrWhiteSpace(content))
     {
         throw new ArgumentException("Null/blank content specified");
     }
     if (!AtomToken.isMustHandleKeyWord(content) && !AtomToken.isContextDependentKeyword(content) && !AtomToken.isMiscKeyWord(content))
     {
         throw new ArgumentException("Invalid content specified - not a VBScript keyword");
     }
 }
        /// <summary>
        /// This inherits from AtomToken since a lot of processing would consider them the same token type while parsing the original content.
        /// </summary>
        public BuiltInValueToken(string content, int lineIndex) : base(content, WhiteSpaceBehaviourOptions.Disallow, lineIndex)
        {
            // Do all this validation (again) here in case this constructor wasn't called by the AtomToken.GetNewToken method
            if (string.IsNullOrWhiteSpace(content))
            {
                throw new ArgumentException("Null/blank content specified");
            }
            if (!AtomToken.isVBScriptValue(content))
            {
                throw new ArgumentException("Invalid content specified - not a VBScript value");
            }

            IsAcceptableAsConstValue = _lowerCasedAcceptableBuiltinValues.Contains(Content.ToLower());
        }
Example #5
0
 /// <summary>
 /// This inherits from AtomToken since a lot of processing would consider them the
 /// same token type while parsing the original content.
 /// </summary>
 public ComparisonOperatorToken(string content, int lineIndex) : base(content, lineIndex)
 {
     // Do all this validation (again) here in case this constructor wasn't called
     // by the AtomToken.GetNewToken method
     if (content == null)
     {
         throw new ArgumentNullException("content");
     }
     if (content == "")
     {
         throw new ArgumentException("Blank content specified for ComparisonToken - invalid");
     }
     if (!AtomToken.isComparison(content))
     {
         throw new ArgumentException("Invalid content specified - not a Comparison");
     }
 }
Example #6
0
 /// <summary>
 /// This inherits from AtomToken since a lot of processing would consider them the
 /// same token type while parsing the original content.
 /// </summary>
 public MemberAccessorOrDecimalPointToken(string content, int lineIndex) : base(content, WhiteSpaceBehaviourOptions.Disallow, lineIndex)
 {
     // Do all this validation (again) here in case this constructor wasn't called
     // by the AtomToken.GetNewToken method
     if (content == null)
     {
         throw new ArgumentNullException("content");
     }
     if (content == "")
     {
         throw new ArgumentException("Blank content specified for MemberAccessorToken - invalid");
     }
     if (!AtomToken.isMemberAccessor(content))
     {
         throw new ArgumentException("Invalid content specified - not a MemberAccessor");
     }
 }
 /// <summary>
 /// This inherits from AtomToken since a lot of processing would consider them the same token type while parsing the original content.
 /// </summary>
 public OperatorToken(string content, int lineIndex) : base(content, WhiteSpaceBehaviourOptions.Disallow, lineIndex)
 {
     // Do all this validation (again) here in case this constructor wasn't called by the AtomToken.GetNewToken method
     if (content == null)
     {
         throw new ArgumentNullException("content");
     }
     if (content == "")
     {
         throw new ArgumentException("Blank content specified for OperatorToken - invalid");
     }
     if (!AtomToken.isOperator(content))
     {
         throw new ArgumentException("Invalid content specified - not an Operator");
     }
     if (AtomToken.isLogicalOperator(content) && (!(this is LogicalOperatorToken)))
     {
         throw new ArgumentException("This content indicates a LogicalOperatorToken but this instance is not of that type");
     }
     if (AtomToken.isComparison(content) && (!(this is ComparisonOperatorToken)))
     {
         throw new ArgumentException("This content indicates a ComparisonOperatorToken but this instance is not of that type");
     }
 }