Skip to content

unLomTrois/lexiCK3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

Golang implementation of linting PDXScript files for Crusader Kings 3

Structure

It is composed of three parts:

  • lexer (tokenizer)
  • parser (LL(1) parser)
  • linter not updated yet

Lexer creates stream of tokens that is consumed by parser, catches lexical errors, like unknown tokens (e.g. you can't write !=)

Parser makes AST (Abstract Syntax Tree), catches syntax errors (e.g. not closed curly brace)

Todo

  • Implement Lexer
  • Add tests on Lexer
  • Implement Parser
  • Update Linter
  • Add tests on Parser
  • Make a VSCode extension

Example of work:

Raw file

image

Linted file:

image

P.S.

If you have zero knowledge in parsing, I recommend watch this playlist first: Building a Parser from scratch

Then you can read first 2-3 chapters of Compilers: Principles, Techniques, and Tools