Package uk.co.real_logic.sbe
Class ValidationUtil
java.lang.Object
uk.co.real_logic.sbe.ValidationUtil
Various validation utilities used across parser, IR, and generator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisCKeyword(String token) Is the token a C language keyword?static booleanisCppKeyword(String token) Is the token a C++ language keyword?static booleanisCSharpKeyword(String token) Is the token a C# language keyword?static booleanisGolangKeyword(String token) Is the token a Go language keyword?static booleanisJavaKeyword(String token) Is this token a Java keyword?static booleanisSbeCName(String value) Check value for validity of usage as a C identifier.static booleanisSbeCppName(String value) Check value for validity of usage as a C++ identifier.static booleanisSbeCSharpName(String value) "Check" value for validity of usage as a csharp identifier.static booleanisSbeGolangName(String value) "Check" value for validity of usage as a golang identifier.static booleanisSbeJavaName(String value) Check string for validity of usage as a Java identifier.static booleanpossibleCSharpKeyword(String value) Is the value a possible C# language keyword?
-
Constructor Details
-
ValidationUtil
public ValidationUtil()
-
-
Method Details
-
isSbeCName
Check value for validity of usage as a C identifier. A programmatic variable must have all elements be a letter or digit or '_'. The first character must not be a digit. And must not be a C keyword.- Parameters:
value- to check- Returns:
- true for validity as a C name. false if not.
-
isCKeyword
Is the token a C language keyword?- Parameters:
token- to be checked.- Returns:
- true if the token a C language keyword.
-
isSbeCppName
Check value for validity of usage as a C++ identifier. A programmatic variable must have all elements be a letter or digit or '_'. The first character must not be a digit. And must not be a C++ keyword.- Parameters:
value- to check- Returns:
- true for validity as a C++ name. false if not.
-
isCppKeyword
Is the token a C++ language keyword?- Parameters:
token- to be checked.- Returns:
- true if the token a C++ language keyword.
-
isSbeJavaName
Check string for validity of usage as a Java identifier. Avoiding keywords.- Parameters:
value- to check- Returns:
- true for validity as a Java name. false if not.
-
isJavaKeyword
Is this token a Java keyword?- Parameters:
token- to be tested.- Returns:
- true if a Java keyword otherwise false.
-
isSbeGolangName
"Check" value for validity of usage as a golang identifier. From: Golang identifiersidentifier = letter { letter | unicode_digit } letter = unicode_letter | "_" .
unicode_letter and unicode_digit are defined in section 4.5 of the unicode standard at Unicode 8.0.0 and the Java Character and Digit functions are unicode friendly
- Parameters:
value- to check- Returns:
- true for validity as a golang name. false if not.
-
isGolangKeyword
Is the token a Go language keyword?- Parameters:
token- to be checked.- Returns:
- true if the token a Go language keyword.
-
isSbeCSharpName
"Check" value for validity of usage as a csharp identifier. C# identifiers Which basically boils down tofirst subsequent* first is { @ | letter | underscore } subsequent is { first | digit | connecting | combining | formatting }*
letter is Lu, Ll, Lt, Lm, Lo, or Nl (possibly escaped) digit is Nd (possibly escaped) connecting is Pc (possibly escaped) combining is Mn or Mc (possibly escaped) formatting is Cf (possibly escaped)
so that all becomes: { @ | _ | Lu | Ll | Lt | Lm | Lo | Nl } { @ | _ | Lu | Ll | Lt | Lm | Lo | Nl | Nd | Pc | Mn | Mc | Cf}*
- Parameters:
value- to check- Returns:
- true for validity as a csharp name. false if not.
-
isCSharpKeyword
Is the token a C# language keyword?- Parameters:
token- to be checked.- Returns:
- true if the token a C# language keyword.
-
possibleCSharpKeyword
Is the value a possible C# language keyword?- Parameters:
value- to be checked.- Returns:
- true if the value is a possible C# language keyword.
-