public static ClepsType GetBasicOrVoidType(ClepsParser.TypenameAndVoidContext typenameAndVoidContext) { if (typenameAndVoidContext.VOID() != null) { return(GetVoidType()); } return(GetBasicType(typenameAndVoidContext.typename())); }
public override object VisitTypenameAndVoid([NotNull] ClepsParser.TypenameAndVoidContext context) { if (context.typename() != null) { return(Visit(context.typename())); } var ret = VoidType.GetVoidType(); return(ret); }
public override LLVMRegister VisitMemberFunctionDeclarationStatement([NotNull] ClepsParser.MemberFunctionDeclarationStatementContext context) { bool isStatic = context.STATIC() != null; ClepsParser.TypenameAndVoidContext returnTypeContext = context.functionDeclarationStatement().FunctionReturnType; ClepsType clepsReturnType = ClepsType.GetBasicOrVoidType(returnTypeContext); ClepsParser.FunctionParametersListContext parametersContext = context.functionDeclarationStatement().functionParametersList(); string functionName = context.functionDeclarationStatement().FunctionName.GetText(); return(VisitFunctionDeclarationBody(context, clepsReturnType, parametersContext, functionName, isStatic)); }
public override int VisitMemberFunctionDeclarationStatement([NotNull] ClepsParser.MemberFunctionDeclarationStatementContext context) { bool isStatic = context.STATIC() != null; var functionDeclarationContext = context.functionDeclarationStatement(); string functionName = functionDeclarationContext.FunctionName.Name.Text; ClepsParser.TypenameAndVoidContext functionReturnContext = functionDeclarationContext.FunctionReturnType; ClepsType clepsReturnType = ClepsType.GetBasicOrVoidType(functionReturnContext); ClepsParser.FunctionParametersListContext parameterContext = functionDeclarationContext.functionParametersList(); var ret = GenerateMemberFunction(context, isStatic, functionName, clepsReturnType, parameterContext); return(ret); }
/// <summary> /// Exit a parse tree produced by <see cref="ClepsParser.typenameAndVoid"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitTypenameAndVoid([NotNull] ClepsParser.TypenameAndVoidContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="ClepsParser.typenameAndVoid"/>. /// <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 VisitTypenameAndVoid([NotNull] ClepsParser.TypenameAndVoidContext context) { return(VisitChildren(context)); }