Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ast.Parser.TypeDefinition
Synopsis
- parseTypeDefinition :: Parser Type
- structType :: Parser Type
- unionType :: Parser Type
- typedefType :: Parser Type
- parseField :: Parser (String, Type)
Documentation
parseTypeDefinition :: Parser Type Source #
Parse a type definition. This function combines multiple specific type definition. It tries to match typedefs, structs, and unions.
structType :: Parser Type Source #
Parses a struct type definition. A struct is defined with the "struct" keyword followed by an optional name and a list of fields enclosed in braces. Example: "struct { x -> int, y -> float }".
unionType :: Parser Type Source #
Parses a union type definition. A union is defined with the "union" keyword followed by an optional name and a list of variants enclosed in braces. Example: "union { data -> *char, error -> int }".
typedefType :: Parser Type Source #
Parses a typedef. A typedef associates a new name with an existing type using the "::" syntax. Example: "Vector2i :: Vector".