slang/parsing/Parser.h file

SystemVerilog language parser.

Contents

Namespaces

namespace slang
Root namespace.

Classes

struct slang::ParserOptions
Contains various options that can control parsing behavior.
class slang::Parser
Implements a full syntax parser for SystemVerilog.
struct slang::Parser::Metadata
Various metadata collected during parsing.
struct slang::Parser::Metadata::Node
Collection of metadata that can be associated with a syntax node at parse time.

Enums

enum class ExpressionOptions { None = 0, PatternContext = 1 << 0, ProceduralAssignmentContext = 1 << 1, ConstraintContext = 1 << 2, AllowSuperNewCall = 1 << 3, SequenceExpr = 1 << 4, DisallowVectors = 1 << 5, BinsSelectContext = 1 << 6, AllowDist = 1 << 7 }
Various options for parsing expressions.
enum class NameOptions { None = 0, ForeachName = 1 << 0, IsFirst = 1 << 1, PreviousWasThis = 1 << 2, PreviousWasLocal = 1 << 3, ExpectingExpression = 1 << 4, SequenceExpr = 1 << 5 }
Various options for parsing names.
enum class TypeOptions { None = 0, AllowImplicit = 1, AllowVoid = 2 }
Various options for parsing types.
enum class FunctionOptions { None = 0, AllowTasks = 1, AllowEmptyArgNames = 2, AllowImplicitReturn = 4, IsPrototype = 8 }
Various options for parsing functions.

Enum documentation

enum class ExpressionOptions

Various options for parsing expressions.

Enumerators
None

No special options specified.

PatternContext

Inside a pattern expression we don't allow a nested pattern expression.

ProceduralAssignmentContext

In a procedural assignment context, <= is a non-blocking assignment, not the less than or equal to operator.

ConstraintContext

In a constraint block context, the -> operator has special meaning.

AllowSuperNewCall

This expression is in a context where "super.new" calls are allowed. They are restricted to the first statement in a class constructor.

SequenceExpr

This expression is inside a sequence expression.

DisallowVectors

When parsing a primary expression, don't parse a full integer vector but instead just the first integer literal token.

BinsSelectContext

In a bins select context the && and || operators should be left to the bins parsing instead of being part of the expression itself.

AllowDist

"dist" expressions are allowed in this context.

enum class NameOptions

Various options for parsing names.

Enumerators
None

No special options specified.

ForeachName

Parsing the name of a foreach variable.

IsFirst

This is the first element of a potentially dotted name path.

PreviousWasThis

The previous element in the name path was the 'this' keyword.

PreviousWasLocal

The previous element in the name path was the 'local' keyword.

ExpectingExpression

We are expecting an expression while parsing this name.

SequenceExpr

This name is inside a sequence expression.

enum class TypeOptions

Various options for parsing types.

Enumerators
None

No special options specified.

AllowImplicit

Allow implicit types, e.g. just a signing or dimension list.

AllowVoid

Allow void types.

enum class FunctionOptions

Various options for parsing functions.

Enumerators
None

No special options specified.

AllowTasks

Allow tasks (as opposed to just functions).

AllowEmptyArgNames

Allow formal argument names to be ommitted.

AllowImplicitReturn

Allow the return type to be ommitted.

IsPrototype

The function header is for a prototype, so parsing rules are slightly different.