Skip to content

Nikindrik/Configuration-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Configuration language

This is a command line tool for the tutorial configuration language, the syntax of which is given below. This tool converts text from the input format to the output format. Syntax errors are detected and messages are issued. The input text in the tutorial configuration language is taken from a file with the extension .txt. The output text in the yaml language is written to the standard output.

πŸ“˜ Installation and running

git clone https://github.com/Nikindrik/Configuration-language
python -m venv venv

For windows

.\venv\Scripts\activate
pip install pyyaml

For linux/UNIX/MAC

source venv/bin/activate
pip install pyyaml

Run

python main.py <input.txt>

Example

python main.py 1.txt

πŸ’» The command line switches are set:

  • Input <name.txt> file

πŸ–ΌοΈ Results Gallery

img.png

img.png

πŸ“š Sintaxis of Configuration language

ΠžΠ΄Π½ΠΎΡΡ‚Ρ€ΠΎΡ‡Π½Ρ‹Π΅ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ:
\ Π­Ρ‚ΠΎ однострочный ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ
ΠœΠ½ΠΎΠ³ΠΎΡΡ‚Ρ€ΠΎΡ‡Π½Ρ‹Π΅ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ:
<!--
Π­Ρ‚ΠΎ многострочный
ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ
-->
ΠœΠ°ΡΡΠΈΠ²Ρ‹:
{ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅. Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅. Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅. ... }
Π‘Π»ΠΎΠ²Π°Ρ€ΠΈ:
([
 имя : Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅,
 имя : Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅,
 имя : Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅,
 ...
])
ИмСна:
[_a-zA-Z][_a-zA-Z0-9]*
ЗначСния:
β€’ Числа.
β€’ Π‘Ρ‚Ρ€ΠΎΠΊΠΈ.
β€’ ΠœΠ°ΡΡΠΈΠ²Ρ‹.
β€’ Π‘Π»ΠΎΠ²Π°Ρ€ΠΈ.
Π‘Ρ‚Ρ€ΠΎΠΊΠΈ:
@"Π­Ρ‚ΠΎ строка"
ОбъявлСниС константы Π½Π° этапС трансляции:
имя := Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅
ВычислСниС константы Π½Π° этапС трансляции:
!(имя)

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages