internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifierToken, IOilexerGrammarProductionRuleEntry primary) { if (reclassifications.ContainsKey(identifierToken)) { return; } reclassifications.Add(identifierToken, OilexerGrammarTokenType.RuleReference); }
protected override void DefineRuleSoftReference(OilexerGrammarTokens.IdentifierToken primary, OilexerGrammarTokens.IdentifierToken secondary = null) { primary.SetTokenType(OilexerGrammarTokenType.SoftReference); if (secondary != null) { secondary.SetTokenType(OilexerGrammarTokenType.SoftReference); } }
internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifierToken, IProductionRuleTemplatePart item) { if (reclassifications.ContainsKey(identifierToken)) { return; } reclassifications.Add(identifierToken, OilexerGrammarTokenType.RuleTemplateParameterReference); }
internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifierToken, ITokenItem primary) { if (reclassifications.ContainsKey(identifierToken)) { return; } if (primary is ILiteralCharTokenItem) { reclassifications.Add(identifierToken, OilexerGrammarTokenType.CharacterLiteral); } else if (primary is ILiteralStringTokenItem) { reclassifications.Add(identifierToken, OilexerGrammarTokenType.StringLiteral); } }
internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifier, ReclassificationKind reclassificationKind) { if (reclassifications.ContainsKey(identifier)) { return; } switch (reclassificationKind) { case ReclassificationKind.Keyword: case ReclassificationKind.NativeMethod: reclassifications.Add(identifier, OilexerGrammarTokenType.Keyword); break; default: break; } }
protected override void DefineRuleTemplateParameterIdentifier(OilexerGrammarTokens.IdentifierToken id, IProductionRuleTemplatePart currentPart) { this.Handler.ReclassifyToken(id, currentPart); }
protected override void DefineRuleTemplateIdentifier(OilexerGrammarTokens.IdentifierToken ruleTemplateIdentifier, IOilexerGrammarProductionRuleTemplateEntry ruleTemplateEntry) { this.Handler.ReclassifyToken(ruleTemplateIdentifier, ruleTemplateEntry); }
protected override void DefineTokenIdentifier(OilexerGrammarTokens.IdentifierToken tokenIdentifier, IOilexerGrammarTokenEntry tokenEntry) { this.Handler.ReclassifyToken(tokenIdentifier, tokenEntry); }
protected override void DefineCommandIdentifier(OilexerGrammarTokens.IdentifierToken commandIdentifier) { this.Handler.ReclassifyToken(commandIdentifier, ReclassificationKind.NativeMethod); }
protected override void DefineKeywordIdentifier(OilexerGrammarTokens.IdentifierToken keywordIdentifier) { this.Handler.ReclassifyToken(keywordIdentifier, ReclassificationKind.Keyword); }
/// <summary> /// Creates a new <see cref="PreprocessorCExp"/> with the <paramref name="identifier"/>, /// <paramref name="column"/>, <paramref name="line"/>, and <paramref name="position"/>. /// </summary> /// <param name="identifier">The identifier represented by the <see cref="PreprocessorCExp"/></param> /// <param name="column">The column at the current <paramref name="line"/> the /// <see cref="PreprocessorCExp"/> was declared at. </param> /// <param name="line">The line index the <see cref="PreprocessorCExp"/> was declared at.</param> /// <param name="position">The position in the file the <see cref="PreprocessorCExp"/> /// was declared at.</param> public PreprocessorCPrimary(OilexerGrammarTokens.IdentifierToken identifier, int column, int line, long position) : base(column, line, position) { this.rule = 4; this.identifier = identifier; }