Beispiel #1
0
        public override LLVMRegister VisitMemberOperatorFunctionDeclarationStatement([NotNull] ClepsParser.MemberOperatorFunctionDeclarationStatementContext context)
        {
            bool isStatic = context.STATIC() != null;

            ClepsParser.TypenameContext returnTypeContext = context.operatorFunctionDeclarationStatment().FunctionReturnType;
            ClepsType clepsReturnType = ClepsType.GetBasicType(returnTypeContext);

            ClepsParser.FunctionParametersListContext parametersContext = context.operatorFunctionDeclarationStatment().functionParametersList();
            string functionName = context.operatorFunctionDeclarationStatment().FunctionName.GetText();

            return(VisitFunctionDeclarationBody(context, clepsReturnType, parametersContext, functionName, isStatic));
        }
Beispiel #2
0
        public override int VisitMemberOperatorFunctionDeclarationStatement([NotNull] ClepsParser.MemberOperatorFunctionDeclarationStatementContext context)
        {
            bool   isStatic = context.STATIC() != null;
            var    assignmentFunctionDeclarationStatement = context.operatorFunctionDeclarationStatment();
            string functionName = assignmentFunctionDeclarationStatement.FunctionName.GetText();

            ClepsParser.TypenameContext functionReturnContext = assignmentFunctionDeclarationStatement.FunctionReturnType;
            ClepsType clepsReturnType = ClepsType.GetBasicType(functionReturnContext);

            ClepsParser.FunctionParametersListContext parameterContext = assignmentFunctionDeclarationStatement.functionParametersList();
            var ret = GenerateMemberFunction(context, isStatic, functionName, clepsReturnType, parameterContext);

            return(ret);
        }