S
S
sandul232020-11-12 12:13:37
Programming languages
sandul23, 2020-11-12 12:13:37

How to create your own markup language?

Hello everyone, I sat like that, thought about what to do, decided to create my own PL, read articles on the topic, decided that PL is certainly good, well, a little not relevant, there are a myriad of APs, then I thought: what if we make a markup language like HTML? Just in the future, it will come in handy for a courseworker. I surfed the entire Internet, didn’t emphasize anything useful for myself. I came here to ask for advice . Just please don’t be clever, for example: “ to do this, you need to work in a cool startup, etc.", I'm not asking to get such an answer, but to learn the principles of creation, let's say the basics, because if everything is more or less clear with the PL, the kernel, the compiler / interpreter, etc., then nothing is clear with this, can I please explain the basics, what, how, where, when, in what language to write, or you don’t need to write it, in general, please explain how it all works

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2020-11-12
@begemot_sun

1. Decide on the shape of the tongue. What does he do to you, what does he do.
2. Learn how to parse the text of such a language, what tools are available for this.
3. Using the tools to make a lexer, a parser of your language. Make a grammar of the language.
4. Make a program that will accept text in the language as input, and will give an AST tree at the output.
5. Make an AST tree parser that will take a tree as input, some data, and will transform the data according to this AST tree.
6. Congratulations - you have made your interpreter.
Language example: https://gist.github.com/loguntsov/e63c18ddbdc75937...
Grammar example for it: https://gist.github.com/loguntsov/83b2276b7a855a76...

V
Vladimir Korotenko, 2020-11-12
@firedragon

Google lexer and tokenizer. But what are you going to mark? In my practice, only once it was necessary to write a reporting language and then to restrict the user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question