private static ITokenItem ResolveTokenExpressionItem(this ITokenItem item, IOilexerGrammarTokenEntry entry, OilexerGrammarFile file, ICompilerErrorCollection errors)
 {
     if (item is ITokenGroupItem)
     {
         ((ITokenGroupItem)(item)).ResolveTokenExpressionSeries(entry, file, errors);
         return item;
     }
     else if (item is ISoftReferenceTokenItem)
     {
         return ((ISoftReferenceTokenItem)(item)).ResolveSoftReference(entry, file, errors);
     }
     else if (item is ICommandTokenItem)
     {
         ((ICommandTokenItem)(item)).ResolveSoftReference(entry, file, errors);
         return item;
     }
     else if (item is ILiteralStringTokenItem)
     {
         ILiteralStringTokenItem ilsti = ((ILiteralStringTokenItem)item);
         if (ilsti.Value.Length == 1)
         {
             LiteralCharTokenItem result = new LiteralCharTokenItem(ilsti.Value[0], ilsti.CaseInsensitive, ilsti.Column, ilsti.Line, ilsti.Position);
             ((LiteralStringTokenItem)(item)).CloneData(result);
             return result;
         }
     }//*/
     return item;
 }
Exemple #2
0
 /// <summary>
 /// Creates a new <see cref="InlinedLiteralStringTokenItem"/> with the
 /// <paramref name="source"/>, and <paramref name="parent"/> provided.
 /// </summary>
 /// <param name="source">The <see cref="ILiteralStringTokenItem"/> from which
 /// the <see cref="InlinedLiteralStringTokenItem"/> is derived.</param>
 /// <param name="sourceRoot">The <see cref="IOilexerGrammarTokenEntry"/> which contains
 /// the <paramref name="source"/>.</param>
 /// <param name="root">The <see cref="InlinedTokenEntry"/> which roots the entire
 /// token structure.</param>
 public InlinedLiteralStringTokenItem(ILiteralStringTokenItem source, IOilexerGrammarTokenEntry sourceRoot, InlinedTokenEntry root)
     : base(source.Value, source.CaseInsensitive, source.Column, source.Line, source.Position, source.SiblingAmbiguity)
 {
     this.SourceRoot       = sourceRoot;
     this.Source           = source;
     this.Root             = root;
     this.SiblingAmbiguity = source.SiblingAmbiguity;
     this.RepeatOptions    = source.RepeatOptions;
     this.Name             = source.Name;
 }