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

Ast.Parser.Program

Synopsis

Documentation

parseProgram :: String -> Parser Program Source #

Parses a program by first preprocessing the source file and then parsing its components. Components can be type definitions or expressions. Returns an Program containing the parsed global expressions, types, and the source file name.

parseTypeDefinition :: Parser Program Source #

Parses a type definition and wraps it in an Program structure. Returns a program with the parsed type definition as a global type.

parseExpr :: Parser Program Source #

Parses an expression and wraps it in an Program structure. Returns a program with the parsed expression as a global expression.

globalExpr :: Expr -> (String, Expr) Source #

Converts a parsed expression into a global expression. Returns a tuple containing the name of the global expression and the expression itself.

globalType :: Type -> (String, Type) Source #

Converts a parsed type into a global type. Returns a tuple containing the name of the global type and the type itself.