Skip to content
yassir RAMDANI edited this page Sep 15, 2020 · 3 revisions

“SwiLex”/

A universal lexer library in Swift.

Introduction

In computer science a Lexer or a tokenizer is a program that converts a sequence of characters (raw string) into a sequence of tokens.

SwiLex is a universal lexer which means that you can use it to build any lexer only by defining your tokens in a Swift enum (in few lines of code).

And soon with SwiParse it will allow to build a full Parser.

Features

  • Tokens defined using only a simple SwiLexable enum.
  • Support conditional tokens with custom modes.
  • Support actions on each match by implementing the onLex(raw: Substring) function.
  • Errors with line number and the issue's substring.
  • Add detailed documentation with more examples.
  • Support Cocoapods and Carthage.
  • 🔥 Create SwiParse, a tool that can be linked to SwiLex to generate a full parser. (in progress ...) 🔥
Clone this wiki locally