public override SyntaxNode VisitTypeDeclaration([NotNull] GrammarParser.TypeDeclarationContext context) { var name = context.GetText() .Replace("vector<byte>", "byte[]", StringComparison.OrdinalIgnoreCase) .Replace("vector<", "List<", StringComparison.OrdinalIgnoreCase) .Replace("map<", "Dictionary<", StringComparison.OrdinalIgnoreCase); return(SyntaxFactory.ParseTypeName(name)); }
/// <summary> /// Exit a parse tree produced by <see cref="GrammarParser.typeDeclaration"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitTypeDeclaration([NotNull] GrammarParser.TypeDeclarationContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="GrammarParser.typeDeclaration"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitTypeDeclaration([NotNull] GrammarParser.TypeDeclarationContext context) { return(VisitChildren(context)); }