LexLeo 0.0.0-dev+f8e5087-dirty
Technical documentation
Loading...
Searching...
No Matches
lexleo_token.h File Reference
Include dependency graph for lexleo_token.h:

Go to the source code of this file.

Data Structures

struct  lexleo_token_t
 

Typedefs

typedef enum lexleo_token_kind_t lexleo_token_kind_t
 
typedef struct lexleo_token_t lexleo_token_t
 

Enumerations

enum  lexleo_token_kind_t {
  LEX_TK_INVALID = 0 , LEX_TK_LBRACE , LEX_TK_RBRACE , LEX_TK_LPAREN ,
  LEX_TK_RPAREN , LEX_TK_ADD , LEX_TK_SUBTRACT , LEX_TK_MULTIPLY ,
  LEX_TK_DIVIDE , LEX_TK_SEMICOLON , LEX_TK_COMMA , LEX_TK_EQUAL ,
  LEX_TK_READ , LEX_TK_WRITE , LEX_TK_DEFINE , LEX_TK_CALL ,
  LEX_TK_QUOTE , LEX_TK_EVAL , LEX_TK_SYMBOL , LEX_TK_SET ,
  LEX_TK_IF , LEX_TK_THEN , LEX_TK_ELSE , LEX_TK_WHILE ,
  LEX_TK_DO , LEX_TK_INTEGER , LEX_TK_STRING , LEX_TK_SYMBOL_NAME ,
  LEX_TK_EOF
}
 

Typedef Documentation

◆ lexleo_token_kind_t

Kind of lexical token produced by a lexer backend (Flex, etc.).

This enum is backend-agnostic and parser-agnostic. It represents the lexical contract of the language.

◆ lexleo_token_t

Lexical token.

Ownership rules:

  • For LEX_TK_STRING and LEX_TK_SYMBOL_NAME, string_value is heap-allocated and ownership is transferred to the token consumer.
  • For other token kinds, the union content is unspecified.

Enumeration Type Documentation

◆ lexleo_token_kind_t

Kind of lexical token produced by a lexer backend (Flex, etc.).

This enum is backend-agnostic and parser-agnostic. It represents the lexical contract of the language.

Enumerator
LEX_TK_INVALID 
LEX_TK_LBRACE 
LEX_TK_RBRACE 
LEX_TK_LPAREN 
LEX_TK_RPAREN 
LEX_TK_ADD 
LEX_TK_SUBTRACT 
LEX_TK_MULTIPLY 
LEX_TK_DIVIDE 
LEX_TK_SEMICOLON 
LEX_TK_COMMA 
LEX_TK_EQUAL 
LEX_TK_READ 
LEX_TK_WRITE 
LEX_TK_DEFINE 
LEX_TK_CALL 
LEX_TK_QUOTE 
LEX_TK_EVAL 
LEX_TK_SYMBOL 
LEX_TK_SET 
LEX_TK_IF 
LEX_TK_THEN 
LEX_TK_ELSE 
LEX_TK_WHILE 
LEX_TK_DO 
LEX_TK_INTEGER 
LEX_TK_STRING 
LEX_TK_SYMBOL_NAME 
LEX_TK_EOF 

Definition at line 14 of file lexleo_token.h.