class
#include <slang/syntax/SyntaxFacts.h>
SyntaxFacts A collection of static methods that query various facts related to tokens and syntax nodes.
Public static functions
- static auto getUnaryPrefixExpression(TokenKind kind) -> SyntaxKind
- static auto getUnaryPostfixExpression(TokenKind kind) -> SyntaxKind
- static auto getLiteralExpression(TokenKind kind) -> SyntaxKind
- static auto getBinaryExpression(TokenKind kind) -> SyntaxKind
- static auto getBinarySequenceExpr(TokenKind kind) -> SyntaxKind
- static auto getBinaryPropertyExpr(TokenKind kind) -> SyntaxKind
- static auto getKeywordNameExpression(TokenKind kind) -> SyntaxKind
- static auto getIntegerType(TokenKind kind) -> SyntaxKind
- static auto getKeywordType(TokenKind kind) -> SyntaxKind
- static auto getProceduralBlockKind(TokenKind kind) -> SyntaxKind
- static auto getModuleDeclarationKind(TokenKind kind) -> SyntaxKind
- static auto getModuleHeaderKind(TokenKind kind) -> SyntaxKind
- static auto getModuleEndKind(TokenKind kind) -> TokenKind
- static auto getDelimCloseKind(TokenKind kind) -> TokenKind
- static auto getSkipToKind(TokenKind kind) -> TokenKind
- static auto getPrecedence(SyntaxKind kind) -> int
- static auto isSpecialMethodName(SyntaxKind kind) -> bool
- static auto isRightAssociative(SyntaxKind kind) -> bool
- static auto isPossibleDataType(TokenKind kind) -> bool
- static auto isPossibleExpression(TokenKind kind) -> bool
- static auto isPossibleStatement(TokenKind kind) -> bool
- static auto isNetType(TokenKind kind) -> bool
- static auto isPortDirection(TokenKind kind) -> bool
- static auto isPossibleArgument(TokenKind kind) -> bool
- static auto isPossibleParamAssignment(TokenKind kind) -> bool
- static auto isOpenDelimOrKeyword(TokenKind kind) -> bool
- static auto isCloseDelimOrKeyword(TokenKind kind) -> bool
- static auto isComma(TokenKind kind) -> bool
- static auto isSemicolon(TokenKind kind) -> bool
- static auto isCloseBrace(TokenKind kind) -> bool
- static auto isIdentifierOrComma(TokenKind kind) -> bool
- static auto isNotIdOrComma(TokenKind kind) -> bool
- static auto isPossibleExpressionOrComma(TokenKind kind) -> bool
- static auto isPossibleExpressionOrCommaOrDefault(TokenKind kind) -> bool
- static auto isPossibleExpressionOrTripleAnd(TokenKind kind) -> bool
- static auto isPossibleExpressionOrEquals(TokenKind kind) -> bool
- static auto isPossibleForInitializer(TokenKind kind) -> bool
- static auto isPossibleValueRangeElement(TokenKind kind) -> bool
- static auto isPossiblePattern(TokenKind kind) -> bool
- static auto isPossiblePatternOrComma(TokenKind kind) -> bool
- static auto isPossibleDelayOrEventControl(TokenKind kind) -> bool
- static auto isPossibleInstance(TokenKind kind) -> bool
- static auto isPossibleUdpEntry(TokenKind kind) -> bool
- static auto isPossibleRsRule(TokenKind kind) -> bool
- static auto isEndKeyword(TokenKind kind) -> bool
- static auto isDeclarationModifier(TokenKind kind) -> bool
- static auto isLifetimeModifier(TokenKind kind) -> bool
- static auto isMemberQualifier(TokenKind kind) -> bool
- static auto isMethodQualifier(TokenKind kind) -> bool
- static auto isPropertyQualifier(TokenKind kind) -> bool
- static auto isConstraintQualifier(TokenKind kind) -> bool
- static auto isDriveStrength(TokenKind kind) -> bool
- static auto isChargeStrength(TokenKind kind) -> bool
- static auto isGateType(TokenKind kind) -> bool
- static auto isEndOfParenList(TokenKind kind) -> bool
- static auto isEndOfBracedList(TokenKind kind) -> bool
- static auto isEndOfBracketedList(TokenKind kind) -> bool
- static auto isEndOfCaseItem(TokenKind kind) -> bool
- static auto isEndOfConditionalPredicate(TokenKind kind) -> bool
- static auto isEndOfAttribute(TokenKind kind) -> bool
- static auto isEndOfParameterList(TokenKind kind) -> bool
- static auto isEndOfTransSet(TokenKind kind) -> bool
- static auto isNotInType(TokenKind kind) -> bool
- static auto isNotInPortReference(TokenKind kind) -> bool
- static auto isNotInConcatenationExpr(TokenKind kind) -> bool
- static auto isNotInParameterList(TokenKind kind) -> bool
- static auto isPossiblePropertyPortItem(TokenKind kind) -> bool
- static auto isPossibleAnsiPort(TokenKind kind) -> bool
- static auto isPossibleNonAnsiPort(TokenKind kind) -> bool
- static auto isPossibleUdpPort(TokenKind kind) -> bool
- static auto isPossibleModportPort(TokenKind kind) -> bool
- static auto isPossibleFunctionPort(TokenKind kind) -> bool
- static auto isPossibleParameter(TokenKind kind) -> bool
- static auto isPossiblePortConnection(TokenKind kind) -> bool
- static auto isPossibleVectorDigit(TokenKind kind) -> bool
- static auto isPossibleLetPortItem(TokenKind kind) -> bool
- static auto isPossibleTransSet(TokenKind kind) -> bool
- static auto isPossibleTimingCheckArg(TokenKind kind) -> bool
- static auto isPossibleEdgeDescriptor(TokenKind kind) -> bool
- static auto isBeforeOrSemicolon(TokenKind kind) -> bool
- static auto isMatchingDelims(TokenKind openKind, TokenKind closeKind) -> bool
- static auto isModifierAllowedAfter(TokenKind mod, TokenKind prev) -> bool
- static auto isAllowedInCompilationUnit(SyntaxKind kind) -> bool
- static auto isAllowedInGenerate(SyntaxKind kind) -> bool
- static auto isAllowedInModule(SyntaxKind kind) -> bool
- static auto isAllowedInInterface(SyntaxKind kind) -> bool
- static auto isAllowedInProgram(SyntaxKind kind) -> bool
- static auto isAllowedInAnonymousProgram(SyntaxKind kind) -> bool
- static auto isAllowedInPackage(SyntaxKind kind) -> bool
- static auto isAllowedInClocking(SyntaxKind kind) -> bool
- static auto isAllowedInChecker(SyntaxKind kind) -> bool
- static auto isStrength0(TokenKind kind) -> bool
- static auto isStrength1(TokenKind kind) -> bool
- static auto isAssignmentOperator(SyntaxKind kind) -> bool
-
static auto getSimpleTypeName(const DataTypeSyntax& syntax) -> std::
string_view
Function documentation
static SyntaxKind slang:: syntax:: SyntaxFacts:: getUnaryPrefixExpression(TokenKind kind)
Returns | the kind of syntax that should be created for the given unary prefix operator token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getUnaryPostfixExpression(TokenKind kind)
Returns | the kind of syntax that should be created for the given unary postfix operator token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getLiteralExpression(TokenKind kind)
Returns | the kind of syntax that should be created for the given literal token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getBinaryExpression(TokenKind kind)
Returns | the kind of syntax that should be created for the given binary operator token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getBinarySequenceExpr(TokenKind kind)
Returns | the kind of syntax that should be created for the given binary sequence operator token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getBinaryPropertyExpr(TokenKind kind)
Returns | the kind of syntax that should be created for the given binary property operator token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getKeywordNameExpression(TokenKind kind)
Returns | the kind of syntax that should be created for the given name keyword token (like "this" or "super"). |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getIntegerType(TokenKind kind)
Returns | the kind of syntax that should be created for the given built-in integer keyword token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getKeywordType(TokenKind kind)
Returns | the kind of syntax that should be created for the given built-in non-integer keyword token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getProceduralBlockKind(TokenKind kind)
Returns | the kind of syntax that should be created for the given block token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getModuleDeclarationKind(TokenKind kind)
Returns | the kind of syntax that should be created for the given module / program / interface token. |
---|
static SyntaxKind slang:: syntax:: SyntaxFacts:: getModuleHeaderKind(TokenKind kind)
Returns | the kind of syntax that should be created for the given module / program / interface header token. |
---|
static TokenKind slang:: syntax:: SyntaxFacts:: getModuleEndKind(TokenKind kind)
Returns | the corresponding end token for the opening module / program / interface token. |
---|
static TokenKind slang:: syntax:: SyntaxFacts:: getDelimCloseKind(TokenKind kind)
Returns | the corresponding closing delimiter for the given opening delimiter. |
---|
static TokenKind slang:: syntax:: SyntaxFacts:: getSkipToKind(TokenKind kind)
Returns | the preferred token to skip to given the current token being observed (for skipping over invalid / error spans). |
---|
static int slang:: syntax:: SyntaxFacts:: getPrecedence(SyntaxKind kind)
Returns | the operator precedence for the given expression syntax kind. |
---|
static bool slang:: syntax:: SyntaxFacts:: isSpecialMethodName(SyntaxKind kind)
Returns | true if the given syntax is a special method name (like built-in array manipulation methods). |
---|
static bool slang:: syntax:: SyntaxFacts:: isRightAssociative(SyntaxKind kind)
Returns | true if the given expression kind is right associative. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleDataType(TokenKind kind)
Returns | true if the given token represents a possible data type expression. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleExpression(TokenKind kind)
Returns | true if the given token represents a possible expression. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleStatement(TokenKind kind)
Returns | true if the given token represents a possible statement. |
---|
static bool slang:: syntax:: SyntaxFacts:: isNetType(TokenKind kind)
Returns | true if the given token represents a net type. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPortDirection(TokenKind kind)
Returns | true if the given token represents a port direction. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleArgument(TokenKind kind)
Returns | true if the given token represents a possible argument. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleParamAssignment(TokenKind kind)
Returns | true if the given token represents a possible parameter assignment. |
---|
static bool slang:: syntax:: SyntaxFacts:: isOpenDelimOrKeyword(TokenKind kind)
Returns | true if the given token represents an opening delimiter. |
---|
static bool slang:: syntax:: SyntaxFacts:: isCloseDelimOrKeyword(TokenKind kind)
Returns | true if the given token represents a closing delimiter. |
---|
static bool slang:: syntax:: SyntaxFacts:: isComma(TokenKind kind)
Returns | true if the given token represents a comma. |
---|
static bool slang:: syntax:: SyntaxFacts:: isSemicolon(TokenKind kind)
Returns | true if the given token represents a semicolon. |
---|
static bool slang:: syntax:: SyntaxFacts:: isCloseBrace(TokenKind kind)
Returns | true if the given token represents a closing brace. |
---|
static bool slang:: syntax:: SyntaxFacts:: isIdentifierOrComma(TokenKind kind)
Returns | true if the given token represents an identifier or a comma. |
---|
static bool slang:: syntax:: SyntaxFacts:: isNotIdOrComma(TokenKind kind)
Returns | true if the given token is not an identifier or a comma. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleExpressionOrComma(TokenKind kind)
Returns | true if the given token represents a possible expression or a comma. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleExpressionOrCommaOrDefault(TokenKind kind)
Returns | true if the given token represents a possible expression, comma, or "default" keyword. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleExpressionOrTripleAnd(TokenKind kind)
Returns | true if the given token represents a possible expression or "&&&" token. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleExpressionOrEquals(TokenKind kind)
Returns | true if the given token represents a possible expression or an equals sign. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleForInitializer(TokenKind kind)
Returns | true if the given token represents a possible for-statement variable initializer. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleValueRangeElement(TokenKind kind)
Returns | true if the given token represents a possible value range element. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossiblePattern(TokenKind kind)
Returns | true if the given token represents a possible conditional pattern. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossiblePatternOrComma(TokenKind kind)
Returns | true if the given token represents a possible conditional pattern or a comma. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleDelayOrEventControl(TokenKind kind)
Returns | true if the given token represents a possible delay or event control. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleInstance(TokenKind kind)
Returns | true if the given token represents a possible instance. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleUdpEntry(TokenKind kind)
Returns | true if the given token represents a possible UDP body entry. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleRsRule(TokenKind kind)
Returns | true if the given token represents a possible randsequence production rule. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndKeyword(TokenKind kind)
Returns | true if the given token is an ending keyword (like "endmodule", "endfunction", etc). |
---|
static bool slang:: syntax:: SyntaxFacts:: isDeclarationModifier(TokenKind kind)
Returns | true if the given token is a declaration modifier (like "const" or "static"). |
---|
static bool slang:: syntax:: SyntaxFacts:: isLifetimeModifier(TokenKind kind)
Returns | true if the given token is a lifetime modifier (like "automatic" or "static"). |
---|
static bool slang:: syntax:: SyntaxFacts:: isMemberQualifier(TokenKind kind)
Returns | true if the given token is a member qualifer (like "virtual" or "extern"). |
---|
static bool slang:: syntax:: SyntaxFacts:: isMethodQualifier(TokenKind kind)
Returns | true if the given token is a valid qualifier for a class method. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPropertyQualifier(TokenKind kind)
Returns | true if the given token is a valid qualifier for a class property. |
---|
static bool slang:: syntax:: SyntaxFacts:: isConstraintQualifier(TokenKind kind)
Returns | true if the given token is a valid qualifier for a constraint block. |
---|
static bool slang:: syntax:: SyntaxFacts:: isDriveStrength(TokenKind kind)
Returns | true if the given token is a drive strength. |
---|
static bool slang:: syntax:: SyntaxFacts:: isChargeStrength(TokenKind kind)
Returns | true if the given token is a charge strength. |
---|
static bool slang:: syntax:: SyntaxFacts:: isGateType(TokenKind kind)
Returns | true if the given token is a gate type. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfParenList(TokenKind kind)
Returns | true if the given token represents the end of a parenthesized list. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfBracedList(TokenKind kind)
Returns | true if the given token represents the end of a braced list. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfBracketedList(TokenKind kind)
Returns | true if the given token represents the end of a bracketed list. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfCaseItem(TokenKind kind)
Returns | true if the given token represents the end of a case item. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfConditionalPredicate(TokenKind kind)
Returns | true if the given token represents the end of a conditional predicate. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfAttribute(TokenKind kind)
Returns | true if the given token represents the end of an attribute. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfParameterList(TokenKind kind)
Returns | true if the given token represents the end of a parameter list. |
---|
static bool slang:: syntax:: SyntaxFacts:: isEndOfTransSet(TokenKind kind)
Returns | true if the given token represents the end of a "trans" set. |
---|
static bool slang:: syntax:: SyntaxFacts:: isNotInType(TokenKind kind)
Returns | true if the given token is not valid in a data type. |
---|
static bool slang:: syntax:: SyntaxFacts:: isNotInPortReference(TokenKind kind)
Returns | true if the given token is not valid in a port reference. |
---|
static bool slang:: syntax:: SyntaxFacts:: isNotInConcatenationExpr(TokenKind kind)
Returns | true if the given token is not valid in a concatenation expression. |
---|
static bool slang:: syntax:: SyntaxFacts:: isNotInParameterList(TokenKind kind)
Returns | true if the given token is not valid in a parameter list. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossiblePropertyPortItem(TokenKind kind)
Returns | true if the given token represents a possible property port item. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleAnsiPort(TokenKind kind)
Returns | true if the given token represents a possible ansi port. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleNonAnsiPort(TokenKind kind)
Returns | true if the given token represents a possible non-ansi port. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleUdpPort(TokenKind kind)
Returns | true if the given token represents a possible UDP port. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleModportPort(TokenKind kind)
Returns | true if the given token represents a possible modport port. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleFunctionPort(TokenKind kind)
Returns | true if the given token represents a possible function port. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleParameter(TokenKind kind)
Returns | true if the given token represents a possible function parameter. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossiblePortConnection(TokenKind kind)
Returns | true if the given token represents a port connection. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleVectorDigit(TokenKind kind)
Returns | true if the given token represents a possible vector digit. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleLetPortItem(TokenKind kind)
Returns | true if the given token represents a "let" port item. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleTransSet(TokenKind kind)
Returns | true if the given token represents a possible "trans" set. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleTimingCheckArg(TokenKind kind)
Returns | true if the given token represents a possible timing check argument. |
---|
static bool slang:: syntax:: SyntaxFacts:: isPossibleEdgeDescriptor(TokenKind kind)
Returns | true if the given token represents a possible edge descriptor. |
---|
static bool slang:: syntax:: SyntaxFacts:: isBeforeOrSemicolon(TokenKind kind)
Returns | true if the given token is the "before" keyword or a semicolon. |
---|
static bool slang:: syntax:: SyntaxFacts:: isMatchingDelims(TokenKind openKind,
TokenKind closeKind)
Returns | true if the given tokens are matching open / close delimiters. |
---|
static bool slang:: syntax:: SyntaxFacts:: isModifierAllowedAfter(TokenKind mod,
TokenKind prev)
Returns | true if the given mod token is allowed after a token of kind prev |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInCompilationUnit(SyntaxKind kind)
Returns | true if the given syntax node is allowed within a compilation unit. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInGenerate(SyntaxKind kind)
Returns | true if the given syntax node is allowed within a generate block or region. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInModule(SyntaxKind kind)
Returns | true if the given syntax node is allowed within a module definition. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInInterface(SyntaxKind kind)
Returns | true if the given syntax node is allowed within an interface definition. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInProgram(SyntaxKind kind)
Returns | true if the given syntax node is allowed within a program definition. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInAnonymousProgram(SyntaxKind kind)
Returns | true if the given syntax node is allowed within an anonymous program definition. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInPackage(SyntaxKind kind)
Returns | true if the given syntax node is allowed within a package definition. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInClocking(SyntaxKind kind)
Returns | true if the given syntax node is allowed within a clocking block. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAllowedInChecker(SyntaxKind kind)
Returns | true if the given syntax node is allowed within a checker declaration. |
---|
static bool slang:: syntax:: SyntaxFacts:: isStrength0(TokenKind kind)
Returns | true if the given token kind is a drive strength for value '0'. |
---|
static bool slang:: syntax:: SyntaxFacts:: isStrength1(TokenKind kind)
Returns | true if the given token kind is a drive strength for value '1'. |
---|
static bool slang:: syntax:: SyntaxFacts:: isAssignmentOperator(SyntaxKind kind)
Returns | true if the given syntax kind is an assignment operator. |
---|
static std:: string_view slang:: syntax:: SyntaxFacts:: getSimpleTypeName(const DataTypeSyntax& syntax)
Returns | a string representing the name of the given data type, if it has a simple name. |
---|