package baguette_sharp

  1. Overview
  2. Docs

Module Baguette_sharp.LexerSource

General lexer module : generate lexers char by char or word by word (default)

Sourceval read_token : string -> bool -> Token.token_type * int

Take a word and if the lexer is between quotes and returns the corresponding token with Token#string_to_token

Sourceval recognized_token : string list
Sourceval max_lst : 'a -> 'a list -> 'a

Returns the maximum of a list

Sourceval is_a_token_a_keyword : string -> int

Take a string and returns the biggest token matching the keyword

Sourceval type_inference_algorithm : string -> Token.token_type

Runs the type inference algorithm

Sourceval extract_token : string -> int -> Token.token_type * Token.token_type

Take a string with a token in it and returns a couple of Tokens

Sourceval generate_token_with_chars : String.t -> Token.token_type list

The char by char lexer

Sourceval generate_token : string -> Token.token_type list

The word by word lexers

Sourceval validate_parenthesis_and_quote : Token.token_type list -> Parser.parameters

A function to count the parenthesis and validate if every parenthesis are closed and every quotes are doubled

Sourceval automatic_correction_of_parenthesis : Token.token_type list -> Token.token_type list

Algorithm if a parenthesis is closed without having been opened then the token is eliminated at the end close parenthesis are added in case of too much opened parenthesis