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]*
Значения:
• Числа.
• Строки.
• Массивы.
• Словари.
Строки:
@"Это строка"
Объявление константы на этапе трансляции:
имя := значение
Вычисление константы на этапе трансляции:
!(имя)

Releases

No releases published

Packages

No packages published

Languages