public final class Pragma
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
dropEndingComment(java.lang.String pragma)
Remove any trailing comment from a pragma string.
|
static Xnode |
findPrevious(Xnode from,
java.lang.String keyword)
Find a pragma element in the previous nodes containing a given keyword.
|
static boolean |
fromClawPrimitive(Xnode pragma)
Check if the pragma was already continued.
|
static java.lang.String |
getPrefix(Xnode pragma)
Return the pragma prefix.
|
static void |
moveInExecution(Xnode pragma)
If the first pragma statement is located as the first statement of the
execution block, the OMNI Compiler front-end places it with the declaration
block.
|
static java.util.List<java.lang.String> |
split(java.lang.String fullPragma,
int maxColumns,
java.lang.String pragmaPrefix)
Split a long pragma into chunk depending on the maxColumns specified.
|
static void |
splitByCont(Xnode pragma,
java.lang.String prefix,
XcodeProgram xcodeml)
Split the line by its previous continuation mark.
|
static void |
splitByLength(Xnode pragma,
XcodeProgram xcodeml,
java.lang.String prefix)
Split the line by its length and add continuation symbols.
|
public static java.lang.String getPrefix(Xnode pragma)
pragma
- The pragma node.public static java.util.List<java.lang.String> split(java.lang.String fullPragma, int maxColumns, java.lang.String pragmaPrefix)
fullPragma
- The original full pragma value.maxColumns
- Maximum number of columns. This length take into
account the added prefix and continuation symbol.pragmaPrefix
- Prefix used by the pragma.public static void splitByLength(Xnode pragma, XcodeProgram xcodeml, java.lang.String prefix) throws IllegalTransformationException
pragma
- Pragma statement to be splitted.xcodeml
- The XcodeML on which the transformations are
applied.prefix
- Prefix of the directive.IllegalTransformationException
- If the given element is not a
FpragmaStatement.public static void splitByCont(Xnode pragma, java.lang.String prefix, XcodeProgram xcodeml) throws IllegalTransformationException
pragma
- Pragma node.prefix
- Pragma prefix.xcodeml
- Current XcodeML translation unit.IllegalTransformationException
- If the given element is not a
FpragmaStatement.public static java.lang.String dropEndingComment(java.lang.String pragma)
pragma
- Original pragma string.public static boolean fromClawPrimitive(Xnode pragma)
pragma
- Pragma statement to be checked.public static Xnode findPrevious(Xnode from, java.lang.String keyword)
from
- Element to start from.keyword
- Keyword to be found in the pragma.public static void moveInExecution(Xnode pragma)
pragma
- The pragma to be moved.