def newlines(): return _(List(P.nl, empty_valid=True))
def newlines(): return _(List(P.nl, empty_valid=True, discard=False))
"generic", List(Row(A.generic_formal_decl | A.use_decl, ";")[0], empty_valid=True) )[1], generic_formal_decl=Or( A.pragma, A.object_decl, A.full_type_decl, A.formal_subp_decl, Row("with", A.generic_instantiation)[1] ), formal_subp_decl=Row( "with", A.subprogram_spec, _(Opt("is")), Opt("abstract").as_bool(), Opt(Or(A.diamond_expr, A.static_name, A.null_literal)) ) ^ FormalSubpDecl, renaming_clause=Row("renames", A.name) ^ RenamingClause, generic_renaming_decl=Row( "generic", _(Or("package", "function", "procedure")), A.static_name, "renames", A.static_name, A.aspect_specification ) ^ GenericRenamingDecl, generic_instantiation=Row( _(Or("package", "function", "procedure")), A.static_name, "is", "new", A.static_name, Opt("(", A.call_suffix, ")")[1],
def newlines(): return _(List(G.newline, empty_valid=True))
compilation_unit=Row( List(Row(A.context_item, ";")[0], empty_valid=True), List(Row(A.library_item | A.subunit | A.generic_instantiation | A.pragma, ";")[0], empty_valid=True), ) ^ CompilationUnit, entry_body=Row( "entry", A.identifier, Opt(Row("(", "for", A.identifier, "in", A.discrete_subtype_definition, ")") ^ EntryIndexSpec), Opt(A.parameter_profiles), "when", A.expression, "is", A.basic_decls, Opt("begin", A.handled_statements)[1], "end", _(Opt(A.static_name)) ) ^ EntryBody, protected_body=Row( "protected", "body", A.static_name, A.aspect_specification, "is", Opt(A.basic_decls, "end", Opt(A.static_name))[0], Opt((Row("separate", A.aspect_specification)[1]) ^ BodyStub) ) ^ ProtectedBody, task_body=Row( "task", "body", A.static_name, A.aspect_specification, "is", A.basic_decls, Opt("begin", A.handled_statements)[1], "end", _(Opt(A.static_name)) ) ^ TaskBody,
"generic", List(Row(A.generic_formal_decl | A.use_decl, ";")[0], empty_valid=True) )[1], generic_formal_decl=Or( A.pragma, A.object_decl, A.full_type_decl, A.formal_subp_decl, Row("with", A.generic_instantiation)[1] ), formal_subp_decl=Row( "with", A.subprogram_spec, _(Opt("is")), Opt("abstract").as_bool(), Opt(Or(A.diamond_expr, A.name, A.null_literal)), A.aspect_specification ) ^ FormalSubpDecl, renaming_clause=Row("renames", A.name) ^ RenamingClause, generic_renaming_decl=Row( "generic", _(Or("package", "function", "procedure")), A.static_name, "renames", A.static_name, A.aspect_specification ) ^ GenericRenamingDecl, generic_instantiation=Or( generic_instantiation("package", GenericPackageInstantiation), generic_instantiation("procedure", GenericProcedureInstantiation),