[r302]: cmajor++ / Cm / Cm.Parser / Cm.Parser.sll Maximize Restore History

Download this file

Cm.Parser.sll    271 lines (270 with data), 20.4 kB

namespace Cm.Parser
{
    grammar BasicTypeGrammar
    {
        BasicType: TypePtr;
    }
    grammar ClassGrammar
    {
        Class(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ClassTypePtr;
        Inheritance(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ClassTypePtr cls);
        BaseClassTypeExpr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        ClassContentDef(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        Constructor(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var ParameterList parameters, var int parameterIndex, var InitializerList initializers, var Cm::Core::ScopePtr initializerScope): ConstructorPtr;
        StaticConstructor(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var InitializerList initializers, var Cm::Core::ScopePtr initializerScope): StaticConstructorPtr;
        InitializerList(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): InitializerList;
        Initializer(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var std::string name, var ExpressionList arguments): InitializerPtr;
        Destructor(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var ParameterList parameters): DestructorPtr;
        MemberFunction(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var ParameterList parameters, var int parameterIndex): MemberFunctionPtr;
        ConversionFunction(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var ParameterList parameters): MemberFunctionPtr;
        MemberVariable(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): MemberVariablePtr;
    }
    grammar CompilationUnitGrammar
    {
        CompilationUnit(path outputBase, var ParsingContextPtr ctx): CompilationUnitPtr;
        NamespaceContent(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingDirectives(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingDirective(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingAliasDirective(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): AliasPtr;
        UsingNamespaceDirective(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): NamespaceImportPtr;
        Definitions(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        Definition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        NamespaceDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        Namespace(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): NamespacePtr;
        FunctionDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        ConstantDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        EnumerationDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        TypedefDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        ClassDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        DelegateDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        ConceptDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
    }
    grammar ConceptGrammar
    {
        Concept(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ConceptPtr;
        RefinedConcept(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ConceptPtr;
        ConceptBody(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept);
        ConceptBodyConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept): ConstraintPtr;
        Axiom(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept, var AxiomPtr axiom);
        AxiomBody(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, AxiomPtr axiom);
        AxiomStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): std::string;
        TypenameConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string typeParameter): ConstraintPtr;
        SignatureConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept): ConstraintPtr;
        ConstructorConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept): ConstraintPtr;
        DestructorConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept): ConstraintPtr;
        MemberFunctionConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept): ConstraintPtr;
        FunctionConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ConceptPtr concept): ConstraintPtr;
        EmbeddedConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ConstraintPtr;
        WhereConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): WhereConstraintPtr;
        Constraints(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, WhereConstraintPtr whereConstraint);
        IsConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): IsConstraintPtr;
        ConceptOrTypeName(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        MultiParamConstraint(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): MultiParamConstraintPtr;
    }
    grammar ConstantGrammar
    {
        Constant(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ConstantPtr;
    }
    grammar DelegateGrammar
    {
        Delegate(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): DelegateTypePtr;
    }
    grammar EnumerationGrammar
    {
        Enumeration(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): EnumeratedTypePtr;
        EnumerationConstant(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, EnumeratedTypePtr type): EnumerationObjectPtr;
    }
    grammar ExpressionGrammar
    {
        Expression(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        TypeExpr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        Equivalence(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        Implication(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        Disjunction(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        Conjunction(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        BitOr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        BitXor(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        BitAnd(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        Equality(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var Operator op): Cm::Core::ObjectPtr;
        Relational(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var Operator op): Cm::Core::ObjectPtr;
        Shift(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var Operator op): Cm::Core::ObjectPtr;
        Additive(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var Operator op): Cm::Core::ObjectPtr;
        Multiplicative(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var Operator op): Cm::Core::ObjectPtr;
        Prefix(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var Operator op): Cm::Core::ObjectPtr;
        Postfix(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var PostfixExpressionPtr postfixExpr): Cm::Core::ObjectPtr;
        Primary(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        CastExpr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        SizeOfExpr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        ObjectCreationExpr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        NewExpr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        ConstructionExpr(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        ArgumentList(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ExpressionList;
        ExpressionList(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ExpressionList;
    }
    grammar FunctionGrammar
    {
        Function(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): FunctionPtr;
        ReturnType(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        FunctionSetName: std::string;
        Operator: std::string;
        TypeId;
        Parameters(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ParameterList;
        Body(std::string name, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, Cm::Core::ObjectPtr returnTypeExpr, bool memberBody): CompoundStatementPtr;
    }
    grammar IdentifierGrammar
    {
        Identifier: std::string;
        QualifiedId: std::string;
    }
    grammar KeywordGrammar
    {
        Keyword;
    }
    grammar LibraryFileGrammar
    {
        LibraryFile(LibraryContentHandler* contentHandler, path outputBase): LibraryPtr;
        LibraryFileHeader(LibraryContentHandler* contentHandler): LibraryPtr;
        LibraryDeclaration: LibraryPtr;
        AssemblyDeclaration: std::string;
        ReferenceFilePaths(LibraryContentHandler* contentHandler);
        ReferenceDeclaration: std::string;
        SourceFilePaths(LibraryPtr library);
        SourceFileDeclaration: std::string;
        LibraryFileDeclarations(LibraryPtr library, LibraryContentHandler* contentHandler, path outputBase, var ParsingContextPtr ctx);
        ExceptionDeclaration(LibraryPtr library, LibraryContentHandler* contentHandler);
        NamespaceContent(LibraryPtr library, LibraryContentHandler* contentHandler, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        FunctionTemplateRef(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): FunctionTemplateReferencePtr;
        ClassTemplateRef(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ClassTemplateReferencePtr;
        ConceptRef(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ConceptReferencePtr;
        TemplateParamList: IdentifierList;
        SourceFileIndex: int;
        Namespace(LibraryPtr library, LibraryContentHandler* contentHandler, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::NamespacePtr;
        FilePath: std::string;
    }
    grammar LiteralGrammar
    {
        Literal(ParsingContextPtr ctx, var bool unsignedSuffix): ValuePtr;
        IntLiteral(var ulong val, var bool unsignedSuffix): std::pair<ulong, bool>;
        HexLiteral(var ulong val, var bool unsignedSuffix): std::pair<ulong, bool>;
        Null;
    }
    grammar ParameterGrammar
    {
        Parameter(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, int index): ParameterPtr;
        ParameterList(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var int index): ParameterList;
    }
    grammar ProjectFileGrammar
    {
        ProjectFile(std::string config): ProjectPtr;
        ProjectFileHeader(std::string config): ProjectPtr;
        ProjectDeclaration(std::string config): ProjectPtr;
        TargetDeclaration: Target;
        LibraryDeclaration: std::string;
        AssemblyDeclaration: std::string;
        ProjectFileDeclarations(ProjectPtr project);
        ProjectFileDeclaration(ProjectPtr project);
        Configuration: ConfigurationPtr;
        Defines(ConfigurationPtr config);
        Define: DefinePtr;
        DefineValue: std::string;
        LibraryReference: std::string;
        SourceFile: std::string;
        AsmSourceFile: std::string;
        FilePath: std::string;
    }
    grammar SolutionFileGrammar
    {
        SolutionFile: SolutionPtr;
        SolutionDeclaration: SolutionPtr;
        ProjectFileDeclarations(SolutionPtr solution);
        ProjectFileDeclaration: std::string;
        ActiveProject(SolutionPtr solution);
        ProjectDependencies(SolutionPtr solution);
        ProjectDependency: ProjectDependencyNodePtr;
        FilePath: std::string;
    }
    grammar SpecifierGrammar
    {
        Specifiers: Specifiers;
        Specifier: Specifiers;
    }
    grammar StatementGrammar
    {
        Statement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, Cm::Core::ObjectPtr returnTypeExpr, var std::string label): StatementPtr;
        ControlStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr): StatementPtr;
        ReturnStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr): StatementPtr;
        ConditionalStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr): StatementPtr;
        SwitchStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr, var Position pos): SwitchStatementPtr;
        CaseStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, Cm::Core::ObjectPtr returnTypeExpr, var std::string label): CaseStatementPtr;
        CaseExprList(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ExpressionList;
        DefaultStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, Cm::Core::ObjectPtr returnTypeExpr, var std::string label): DefaultStatementPtr;
        GotoCaseStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        GotoDefaultStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        WhileStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr): StatementPtr;
        DoStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr): StatementPtr;
        ForStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr): ForStatementPtr;
        ForInitStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): StatementPtr;
        CompoundStatement(std::string ownerName, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr, bool member): CompoundStatementPtr;
        BreakStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        ContinueStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        GotoStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        TypedefStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        SimpleStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        AssignmentStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        ConstructionStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        Initialization(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ExpressionList;
        DeleteStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        DestroyStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        ThrowStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label): StatementPtr;
        TryStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, std::string label, Cm::Core::ObjectPtr returnTypeExpr): StatementPtr;
        ExceptionHandlers(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, Cm::Core::ObjectPtr returnTypeExpr): ExceptionHandlerList;
        ExceptionHandler(ExceptionHandlerList* handlers, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, Cm::Core::ObjectPtr returnTypeExpr);
        AssertStatement(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): StatementPtr;
    }
    grammar TemplateCompilationUnitGrammar
    {
        TemplateCompilationUnit(Cm::Core::Library* library, path outputBase, var ParsingContextPtr ctx): CompilationUnitPtr;
        NamespaceContent(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingDirectives(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingDirective(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingAliasDirective(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): AliasPtr;
        UsingNamespaceDirective(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): NamespaceImportPtr;
        Definitions(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        Definition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        NamespaceDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        Namespace(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): NamespacePtr;
        FunctionDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        ConstantDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        EnumerationDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        TypedefDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        ClassDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        ConceptDefinition(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
    }
    grammar TemplateGrammar
    {
        TemplateParameterList(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var int index): TemplateParameterList;
        TemplateName(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): TemplateNamePtr;
    }
    grammar TemplateRepositoryFileGrammar
    {
        TemplateRepositoryFile(TemplateRepository* repository, path outputBase, var ParsingContextPtr ctx): CompilationUnitPtr;
        NamespaceContent(TemplateRepository* repository, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingDirectives(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx);
        UsingDirective(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): NamespaceImportPtr;
        Namespace(TemplateRepository* repository, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::NamespacePtr;
        ExternTemplateInstance(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ObjectPtr;
        ClassTemplateInstance(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::ClassTypePtr;
        ClassTemplateInstanceContent(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, ClassTypePtr cls);
        StaticConstructor(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): StaticConstructorPtr;
        Constructor(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var ParameterList parameters, var int parameterIndex): ConstructorPtr;
        Destructor(ClassTypePtr cls, Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx, var ParameterList parameters): DestructorPtr;
        FunctionTemplateInstance(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): Cm::Core::FunctionPtr;
        TemplateArguments(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): ExpressionList;
        FilePath: std::string;
        InstanceFileName: std::string;
    }
    grammar TypedefGrammar
    {
        Typedef(Cm::Core::ScopePtr enclosingScope, ParsingContextPtr ctx): TypedefPtr;
    }
}