Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #3765 > unrolled thread
| Started by | Martin Ward <martin@gkc.org.uk> |
|---|---|
| First post | 2026-09-09 11:55 +0100 |
| Last post | 2026-09-09 11:55 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.compilers
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: A tiny self-hosting compiler used for teaching Martin Ward <martin@gkc.org.uk> - 2026-09-09 11:55 +0100
| From | Martin Ward <martin@gkc.org.uk> |
|---|---|
| Date | 2026-09-09 11:55 +0100 |
| Subject | Re: A tiny self-hosting compiler used for teaching |
| Message-ID | <26-09-013@comp.compilers> |
On 08/09/2026 10:14, ram@zedat.fu-berlin.de wrote:
> | Step-by-Step Algorithm
This is not an angorithm!
For example:
> find the location where the identifier would normally be placed.
Finding where something would "normally be placed" is not an
algorithmic step. It seems to require parsing the abstract declaration
to determine where the identifier would "normally" appear. So one step
in the "algorithm" to parse a declaration is: parse the declaration!
> | - If [], say: "array of . . . " and move past it.
OK. Having moved past "[]", the thing to the left of the current
position is now "[]", so looking to the left of the current position
will never see "*" or a type qualifier.
> | 4. Encountering Parentheses: If you hit a closing parenthesis ) on
> | the right, you must consume all modifiers to the left until you
> | hit the matching opening parenthesis (. Then, step outside the
> | parentheses and repeat from Step 2.
This seems to imply that we can ignore ("consume") anything in
parentheses: these tokens do not affect the dclaration?
> | 5. Final Base Type: When the identifier and all modifiers are
> | consumed, read the leftmost base type (e.g., int, char).
The only step that "consumes" tokens is step 4, the other steps "move
past" tokens and leave them in place without consuming them. So this
"algorithm" cannot consume anything on a simple declaration which has
no parentheses, and so does not terminate on such a declaration. So
this is not an algorithm.
> | [N] Right " . . . array of N . . . "
Above you only had us look for "[]" and not "[N]".
> Lines marked with "| " come from my editing, where I start by writing
> prompts for the chatbot
*Now* we can see where the problem is!
Please, in future, mark the top of your comments with
some indicator such as "AI generated", so that I can skip
your AI slop and not waste time reading and commenting on it.
--
Mary
Dr Mary Ward | Email: martin@gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4
Back to top | Article view | comp.compilers
csiph-web