frostc-1.0.0.0: The Frost Programming Language Compiler
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ast.Parser.Asm

Synopsis

Documentation

parseAsm :: Parser Expr -> Parser Type -> Parser AsmExpr Source #

Parses an inline assembly expression. Takes a `PU.Parser AT.Expr` for expressions and a `PU.Parser AT.Type` for types. Returns an AsmExpr containing: * The assembly code * The assembly constraints * A list of expression arguments * A list of parameter types * A return type * Side-effect flags * Stack alignment flag * An assembly dialect

parseAsmConstraint :: Parser AsmConstraint Source #

Parses an assembly constraint string, which may include an optional output constraint and zero or more input constraints. Returns an AsmConstraint containing an output constraint (if present) and a list of input constraints.

parseConstraintInput :: Parser String Source #

Parses a single assembly input constraint (`"r"` or `"m"`). Returns the parsed String representing the constraint.

parseConstraintOutput :: Parser String Source #

Parses a single assembly output constraint, which is prefixed by `'='` and then expects either `"r"` or `"m"`. Returns the parsed String representing the constraint.

parseAsmDialect :: Parser AsmDialect Source #

Parses the assembly dialect, which can be either Intel or ATT. Returns an AsmDialect.

anyString :: Parser String Source #

Parses a string enclosed in double quotes (`"..."`). Returns the parsed String.