Skip to content

Repository files navigation

SLR Parser

Description

Implementation of the SLR Parser.

How to integrate

use storage, project = "slr_parser", version = "1.0", user = "baitim"

How to run

  1. Clone
    git clone https://github.com/baitim/SLRParser.git

  2. Go to folder
    cd SLRParser

  3. Prepare conan
    uv sync --group dev; source .venv/bin/activate
    conan profile detect --force

  4. Init dependencies
    conan install . --build=missing -s build_type=Release

  5. Build
    cmake --preset release; cmake --build build/Release

  6. Run
    ./build/Release/SLRParser/slr-parser <program>

How to test

  • Run testing
    ctest --test-dir build/Release --output-on-failure

Grammar

program        -> statements
statements     -> statements statement | statements; | empty
statement      -> expression_pls;
expression_pls -> expression_pls bin_oper_pls expression_mul | expression_mul
expression_mul -> expression_mul bin_oper_mul terminal       | terminal 
terminal       -> ( expression ) | number | variable
variable       -> id

Support

This project is created by baitim

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages