diff --git a/Parser/spec/ConditionalLines.rats b/Parser/spec/ConditionalLines.rats new file mode 100644 index 0000000000000000000000000000000000000000..1573803f0753dca387c357705884c64c6347f309 --- /dev/null +++ b/Parser/spec/ConditionalLines.rats @@ -0,0 +1,18 @@ +module ConditionalLines(); + +modify Fortran2008; +import ConditionalLinesTokens; + + +//// // allow OpenMP constructs as executable_constructs +//// ConditionalExecutableConstruct:ExecutableConstruct ::= ExecutableConstruct; +ExecutableConstruct executable_construct += + <ConditionalExecutableConstruct> CL executable_construct +/ <BEGINNING> ... +; + +//// ConditionalDeclarationConstruct:DeclarationConstruct ::= DeclarationConstruct; +DeclarationConstruct declaration_construct += + <ConditionalDeclarationConstruct> CL declaration_construct +/ <BEGINNING> ... +; diff --git a/Parser/spec/ConditionalLinesPrinting.jadd b/Parser/spec/ConditionalLinesPrinting.jadd new file mode 100644 index 0000000000000000000000000000000000000000..fe15880fbf7bb8f859d67e1f841e7eb152799ddd --- /dev/null +++ b/Parser/spec/ConditionalLinesPrinting.jadd @@ -0,0 +1,13 @@ +aspect PrettyPrint { + //// ConditionalExecutableConstruct:ExecutableConstruct ::= ExecutableConstruct; + public void ConditionalExecutableConstruct.prettyPrint(PrettyPrinter s) { + s.append("!$ "); + getExecutableConstruct().prettyPrint(s); + } + + //// ConditionalDeclarationConstruct:DeclarationConstruct ::= DeclarationConstruct; + public void ConditionalDeclarationConstruct.prettyPrint(PrettyPrinter s) { + s.append("!$ "); + getDeclarationConstruct().prettyPrint(s); + } +} \ No newline at end of file diff --git a/Parser/spec/ConditionalLinesTokens.rats b/Parser/spec/ConditionalLinesTokens.rats new file mode 100644 index 0000000000000000000000000000000000000000..85767fb416d7d512e660ac638704e56b7817973f --- /dev/null +++ b/Parser/spec/ConditionalLinesTokens.rats @@ -0,0 +1,5 @@ +module ConditionalLinesTokens(); + +import FortranTokens; + +transient void CL = "!$ " SS;