|
I have actually to implement a wizard for a very very simple "programming language" which supports something about 1% (rather less) of c language. While reading all this stuff about Parsers and CompilerCompiler (also here on CP) I came to the idea to share all my expirience by writing an article about this.
My Immagination about the article:
- A short description what a Parser is doing (my doubts, that this can be described in short)
- Short explanation how one describes a "language" by EBNF (my doubts, that this can be described in short)
- Explain parsing EBNF to generate "the language" Parser
- "The Target Of The Article": How to use the above parsed EBNF to create a wizard
Because the whole path is something recursive (parsing ebnf to create a parser) I have my doubts wheter all this stuff could/should be explained in only one article. On the other hand, should I prescribe the knowledge about parsing?
How you would structure this?
The easier question:
What do article writer suggest? Should I use the online editor (https://www.codeproject.com/script/Articles/Submit.aspx, Option 1) or should I do everything offline Option 2?
Thank you for help.
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Ummm, I took a side route to all fancy formating stuff. I wrote it up in Word with Pictures made sure it looked legible and went from there to the publishing wizzard. My view was if it can be read with out all fancy stuff it's probably good to go, then use all the auto stuff, just my two pennys worth!
|
|
|
|
|
Thank you very much!
Bruno
modified 19-Jan-21 21:04pm.
|
|
|
|
|
I keep meaning to do it in Word (or at least Libre Office) but ... I still end up with the online editor.
But Word has one big advantage: it has a spell check. The online version doesn't...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you very much.
In case I do it in Word (because you doubt about my spelling ) what is needed afterwards? Is it more or less simply copy/paste from word to online Editor to publish?
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Or just email it to Sean and he'll sort it out.
There is a submission template file you can download and open in Word to use as a basis.
This page shows the d/l and where to send the file: Submit a new Article[^]
I look forward to seeing it!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you again.
Quote: I look forward to seeing it!
The template file is ready to see it
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Dear OG, a shy question:
Is it ok for you if I send you a draft to proofread? I think you are the only one who can understand my strange english.
I'm aware that this is really a big request and so I will understand very well if you decline.
Bruno
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Not a problem: you have my email.
Might take me a day or two to proofread it though!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Wow, thank you very much!
Quote: Might take me a day or two
Two days I need some more days (x10, x20) to be ready, I'm still starting on that.
The whole thing I have to develop in Embarcadero c++ and migrate it then to c# for the article so that someone may read it
modified 19-Jan-21 21:04pm.
|
|
|
|
|
They are a lot quicker to read than to write!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
While writing on it I think I feel 1:1 what you mean
At the Moment I wish I would have never announced that I will write an article on this. But because I did it, I have to go through it
Bruno
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Take your time. If it's worth doing, it's not worth rushing - and it can help to walk away for a day or more and then re-read what you have written so far.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
OriginalGriff wrote: The online version doesn't... Yet most browsers do.
Immanentize the Eschaton!
|
|
|
|
|
Only generally in "boring" text boxes: as soon as you start formatting stuff spell check goes out the window.
In fact, even in multiline textboxes, Chrome loses spell check half the time when I paste HTML into a CP box (like this one)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: I still end up with the online editor.
But Word has one big advantage Or two, maybe: The article's still there if a rugrat chews through your Ethernet cable.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
0x01AA wrote: How you would structure this?
Start with everything you want to talk about, put it into an outline of topics/sub-topics.
Start writing either linearly or the parts that you're drawn to first.
As you're writing, update the outline and see how things begin to evolve -- is it getting too long, is there a natural break for a couple articles evolving? Prune stuff that becomes irrelevant or you don't want to deal with.
0x01AA wrote: Should I use the online editor
No - although it's evolved a lot, like being able to save drafts, I find online editing of anything to be a PITA, with the exception of lounge posts, haha. I'm an old fart, so believe it or not, I'm still using FrontPage 2003 for editing. Find a decent HTML editor (harder than it looks, maybe someone can make some recommendations here) that can let you do a split screen of the markup and the WYSIWYG. Write it all offline.
Hint to save you pain: images go in the same folder as wherever your "article.html" is, as image references in CP are now (and have been for quite a while, but it was not always so) "local".
Other hints:
- Main topic headers are H2
- Use bold and italic sparingly
- variable names, methods, etc., in the text should be wrapped with code tags
- code blocks are wrapped in pre tags
- watch your image size, CP likes images no bigger than, um, 600 width (I think) which I violate constantly. One cool technique for really big images is to put upload both a small and a 100% image, and add a link to the 100% image, like "click here for full size image."
- Personally, I like small code blocks. Don't throw a 500 line class at me, break it into individual method code blocks, in between explain what each method does and why (why is sooo important), etc.
More hints: A Guide To Writing Articles For Code Project
Something I've seen people start doing which I really like is a section at the top of the article on "what you will learn", which is cool, because even if I have no interest in a C-like <1% parser, I might be really interested in how EBNF works and other cool geeky things you are covering.
Marc
Latest Article - Merkle Trees
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Visual Studio, no honestly.
|
|
|
|
|
Jörgen Andersson wrote: Visual Studio, not honestly.
FTFY!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Oh come on, he's using Frontpage ffs.
Make a better suggestion instead.
|
|
|
|
|
Thank you very much for this.
Quote: Something I've seen people start doing which I really like is a section at the top of the article on "what you will learn",
A very good tip. The main Thing should be to Point out the way from EBNF to Wizard and how "intermediate" results of this are connected to the Parser stuff. While writing just the sentence before, I have a Feeling that one of the bigger problems will be my english.
Bruno
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Sorry to disturb, please feel free not to answer
What do you think about this Basic layout for the article:
Content
^Introduction
^What you will learn
^Prerequisites
^What is a Parser
^What is EBNF (Extended Backus–Naur form)
^EBNF to data structure
^From EBNF to wizard
^Using the code
:Introduction
This article tries to point out how a simple programming language can be defined by a meta language like EBNF (Extended Backus–Naur form) and how a parser and - the main aspect here- a wizard can be build based on such a meta definition.
Since the whole topic is very wide, we will concentrate here on the theme "From EBNF to Wizard". The also very intersting part to develop a CompilerCompiler (CoCo) is addressed in a minor way. Minor, because you can find a lot about CoCo in www e.g.
- https://www.codeproject.com/Articles/343646/Mathematical-Expression-Parser-Using-Coco-R
- .... TODO much more
:What you will learn
How to create a wizard for a formal defined "programming language" - defined e.g. by a meta language like EBNF.
:Prerequisites
It is an advantage if you allready have some basics knowledege about parsing (lexical analysis, syntacticals analysis, semantic analysis) and also some knowledge about EBNF.
In case you are familar with this stuff you can skip the next two sections and proceed with ^EBNF to data structure
:What is a Parser in short
Keep in mind, this is a very abreviated introduction.
The job of parsing a text can be splitted into three Jobs:
1. Lexcial Analysis
2. Syntactical Analysis
3. Semantic Analysis
While https://de.wikipedia.org/wiki/Compiler#Lexikalische_Analyse does describe these three points togehter (english wiki not) I feel free to translate and summarize them here instead of giving links to wiki:
TODO
:What is EBNF (Extended Backus–Naur form)
TODO
:EBNF to data structure
TODO
:From EBNF to wizard
TODO, the big part here
:Using the code
::Some notes about the code
The code is far away to be optimal or ready for production. Also it will break a lot of times SOLID principles. Why I'm doing it like this:
The main target is to show in a very easy/direct way the relations of the involved aspects, without hiding the essentials by using over engineered code.
Also the code is originally developed with Embarcadero Studio in c++ and to be more up to date I migrated all the stuff to c#
:Points of Interest
TODO
:History
V#.# Inital release yyyy/mm/dd
BTW: I decided to write the very first Version in a simple text Editor - no Pictures etc. - to be sure I concentrate on the content/text.
Bruno
modified 19-Jan-21 21:04pm.
|
|
|
|
|
No problem. The outline is great. Something my readers have commented that they liked, which you elude to with the section on "some notes about the code" is some light (and lighthearted) discussion of the compromises, rabbit holes, and other things I did (including the wrong ones) that I discovered along the way.
BTW, if you'd like me to proofread anything (regarding your concern about English) I'd be happy to offer my editing services.
Also, there's this Table of Contents generator that I use for large articles. It has a couple bugs (no symbols in the headers, and popping two levels breaks further link generation) but otherwise it's a solid tool and there's some comments about how to fix those bugs in the article itself.
Marc
Latest Article - Merkle Trees
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Thanks a lot again for your help.
Proofread anything:
I really appreciate to accept your offer, I allready ask @OriginalGriff to help me on this. Maybe another expirience for me to see the differences between britan and us english... I assume I will see similar (but hopefully easier differences) things compared to when I have to translate EU-Spanish to Argentina/Colombia/Equador/Salvador/Equador/Honduras
Bruno
modified 19-Jan-21 21:04pm.
|
|
|
|