Skip to content

siguici/vyacc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 Vyacc – LALR(1) Parser Generator in V

Vyacc is a LALR(1) parser generator written in Vlang, inspired by Yacc/Bison but designed to be modern, simple, and modular.
Its main goal is to make the development of programming languages, DSLs, and robust parsers easier and more efficient.


🚀 Features

  • 📚 Full support for LALR(1) grammars
  • 🛠 Automatic AST (Abstract Syntax Tree) generation
  • 🏎 Native performance powered by V
  • 🎯 Clear syntax, familiar to Yacc/Bison users
  • 🔗 Easy integration with your V projects

⚙️ Installation

🔹 Via VPM (Recommended)

v install siguici.vyacc

📦 Vyacc on VPM


🔹 Via Git

mkdir -p ${VMODULES:-$HOME/.vmodules}/siguici
git clone --depth=1 https://github.com/siguici/vyacc ${VMODULES:-$HOME/.vmodules}/siguici/vyacc

🔹 As a project dependency

In your v.mod file:

Module {
  dependencies: ['siguici.vyacc']
}

🔹 Native installers

The repository also provides native installers for manual installation:

  • Linux / macOS : install.sh
  • Windows : install.ps1

🖥 Usage

Minimal example of a grammar file example.y:

%token NUMBER
%left '+' '-'
%left '*' '/'

%%
expr: expr '+' expr   { $$ = $1 + $3; }
    | expr '*' expr   { $$ = $1 * $3; }
    | NUMBER          { $$ = $1; }
    ;

Generate the parser:

vyacc example.y -o parser.v
v run parser.v

🧪 Testing

v test .

🤝 Contributing

Contributions are welcome!

  • Fork the repository
  • Create a branch feature/my-feature
  • Submit a PR 🚀

📜 License

Vyacc is distributed under the MIT License. You are free to use, modify, and share it.

Made with ❤️ by Sigui Kessé Emmanuel.

About

A lightweight, fast, and modern parser generator for @vlang.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages