Example #1
0
 /// <summary>
 /// Add a token to the list of transformed token.
 /// </summary>
 /// <param name="transformedTokens">A reference to the current list of transformed tokens.</param>
 /// <param name="tokenPosition">The position of the token to add.</param>
 /// <param name="tokenType">The type of the token to add.</param>
 /// <param name="tokenData">The data of the token to add.</param>
 private void AddToken(
     ref List <TransformedToken> transformedTokens,
     TokenPosition tokenPosition,
     TransformedTokenType tokenType,
     params dynamic[] tokenData
     )
 {
     transformedTokens.Add(
         new TransformedToken(
             tokenPosition,
             tokenType,
             tokenData
             )
         );
 }
Example #2
0
 /// <summary>
 /// Add a token to the list of transformed tokens and increment the
 /// current token index.
 /// </summary>
 /// <param name="transformedTokens">A reference to the current list of transformed tokens.</param>
 /// <param name="currentTokenIndex">A reference to the current token index.</param>
 /// <param name="tokenPosition">The position of the token to add.</param>
 /// <param name="tokenType">The type of the token to add.</param>
 /// <param name="tokenData">The data of the token to add.</param>
 private void AddTokenAndIncrement(
     ref List <TransformedToken> transformedTokens,
     ref int currentTokenIndex,
     TokenPosition tokenPosition,
     TransformedTokenType tokenType,
     params dynamic[] tokenData
     )
 {
     currentTokenIndex++;
     transformedTokens.Add(
         new TransformedToken(
             tokenPosition,
             tokenType,
             tokenData
             )
         );
 }
Example #3
0
 /// <summary>
 /// Constructor for the TransformedToken class.
 /// </summary>
 /// <param name="position">The token's position within the input string.</param>
 /// <param name="type">The type of the token.</param>
 /// <param name="data">The data stored within the token.</param>
 public TransformedToken(TokenPosition position, TransformedTokenType type, params dynamic[] data)
 {
     this.Position = position;
     this.Type     = type;
     this.Data     = data;
 }