OBDDimal / PyUVL

0 stars 0 forks source link

Lezer Parser for UVL #1

Open h3ssto opened 4 months ago

h3ssto commented 4 months ago

Define a Lezer Grammar for UVL.

Lezer: https://lezer.codemirror.net/ Hint: User the interactive lezer tool for development: https://lezer-playground.vercel.app/

UVL is an indentation-based language, so it is probably best to start with something like a YAML grammar.

UVL Example:

features
    Elevator {abstract}
        mandatory
            Behavior {abstract}
                mandatory
                    Modes {abstract}
                        alternative
                            Sabbath
                            FIFO
                            ShortestPath
                optional
                    Service
                    Priorities {abstract}
                        or
                            RushHour
                            FloorPriority
                            PersonPriority
        optional
            VoiceOutput
            CallButtons {abstract}
                alternative
                    DirectedCall
                    UndirectedCall
            Security {abstract}
                mandatory
                    Permission {abstract}
                        or
                            FloorPermission
                            PermissionControl
            Safety {abstract}
                optional
                    Overloaded

constraints
    CallButtons | Sabbath
    DirectedCall => ShortestPath
    UndirectedCall => FIFO | ShortestPath
h3ssto commented 2 months ago

Move all parsing related stuff to https://github.com/OBDDimal/codemirror-lang-uvl

Ateyu commented 1 month ago

Parser related stuff is moved to Repo.

As soon as the uvl-language-package is published, the language can be integrated in the editor.