ml_switcheroo.compiler.frontends.sass.parser¶

SASS Parser Implementation.

This module provides the SassParser, a recursive descent parser that converts a stream of tokens (from SassLexer) into a Structural AST defined in nodes.py.

Classes¶

LabelRef

Base class for instruction operands (Registers, Immediates, etc.).

SassParser

Recursive descent parser for NVIDIA SASS.

Module Contents¶

class ml_switcheroo.compiler.frontends.sass.parser.LabelRef[source]¶

Bases: ml_switcheroo.compiler.frontends.sass.nodes.Operand

Base class for instruction operands (Registers, Immediates, etc.).

name: str¶
__str__() → str[source]¶

Returns the valid SASS string representation of the node.

class ml_switcheroo.compiler.frontends.sass.parser.SassParser(code: str)[source]¶

Recursive descent parser for NVIDIA SASS.

lexer¶
tokens¶
pos = 0¶
parse() → List[ml_switcheroo.compiler.frontends.sass.nodes.SassNode][source]¶

Parses the entire code block.

Returns:

A list of AST nodes.

Return type:

List[SassNode]