ddc-core-0.4.1.3: Disciplined Disciple Compiler core language and type checker.

Safe HaskellNone

DDC.Core.Lexer

Contents

Description

Reference lexer for core langauge parser. Slow but Simple.

The lexers here all use String in place of a real name type. After applying these functions to the program text, we need to use renameTok tok convert the strings in TokNamed tokens into the name type specific to the langauge fragment to be parsed.

Synopsis

Documentation

Lexer

lexModuleWithOffsideSource

Arguments

:: FilePath

Path to source file, for error messages.

-> Int

Starting line number.

-> String

String containing program text.

-> [Token (Tok String)] 

Lex a module and apply the offside rule.

Automatically drop comments from the token stream along the way.

lexExpSource

Arguments

:: FilePath

Path to source file, for error messages.

-> Int

Starting line number.

-> String

String containing program text.

-> [Token (Tok String)] 

Lex a string into tokens.

Automatically drop comments from the token stream along the way.