java.lang.Object
com.maroontress.clione.impl.Digraphs
Provides the facility of digraph substitution.
In general, digraphs are sequences of two characters that appear in source code and should be treated as if they were single characters. In the C programming language, any digraph must always represent a full token by itself. The following table lists all valid operator or punctuator tokens represented with digraphs:
Token | Equivalent |
---|---|
<: | [ |
:> | ] |
<% | { |
%> | } |
%: | # |
%:%: | ## |
Note that both %:#
and #%:
are not equivalent to
token ##
or %:%:
.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic TokenType
Substitutes a number sign (with which the preprocessing directive starts) for the character sequence that the specified transcriber stores in its builder.static TokenType
Substitutes a left brace for the character sequence that the specified transcriber stores in its builder.static TokenType
Substitutes a left bracket for the character sequence that the specified transcriber stores in its builder.static TokenType
Substitutes a right brace for the character sequence that the specified transcriber stores in its builder.static TokenType
Substitutes a right bracket for the character sequence that the specified transcriber stores in its builder.static TokenType
Substitutes a number sign (a preprocessing stringification operator#
) for the character sequence that the specified transcriber stores in its builder.static TokenType
Substitutes a double number sign (a preprocessing token-pasting operator##
) for the character sequence that the specified transcriber stores in its builder.static TokenType
Substitutes a double number sign (that appears other than in the macro declaration) for the character sequence that the specified transcriber stores in its builder.
-
Method Details
-
toDirective
Substitutes a number sign (with which the preprocessing directive starts) for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.DIRECTIVE
).
-
toUnknownDoubleNumberSign
Substitutes a double number sign (that appears other than in the macro declaration) for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.UNKNOWN
).
-
toStringificationOperator
Substitutes a number sign (a preprocessing stringification operator#
) for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.OPERATOR
).
-
toTokenPastingOperator
Substitutes a double number sign (a preprocessing token-pasting operator##
) for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.OPERATOR
).
-
toRightBracket
Substitutes a right bracket for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.PUNCTUATOR
).
-
toLeftBracket
Substitutes a left bracket for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.PUNCTUATOR
).
-
toLeftBrace
Substitutes a left brace for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.PUNCTUATOR
).
-
toRightBrace
Substitutes a right brace for the character sequence that the specified transcriber stores in its builder.- Parameters:
x
- The transcriber.- Returns:
- The token type (
TokenType.PUNCTUATOR
).
-