Naburgondux's profile picture

Published by

published
updated

Category: Web, HTML, Tech

Making a compiler: 1# B


Basically if you dont know what im doing,im doing a compiler which isĀ  a program that can translate human code into machine code.

and the structure of the blogs will be like this:
  • the numbers will mean like just random thoughts im thinking while im having and i want to put here to document like "2: im having problems doing X"
  • every number point will be in different times,i cant put two things at the same time in different number points
  • it will have some insight of what i added in the end.
  • "[n]" means a reference that will later be explained further.
also im doing,at the same time,a string/array manipulation library called Train!!!! when i do {TRAIN} its because im talking about it, and i will be documenting this library too here.

starting now!

  1. ok,im adding the open file capabilty to main.c
  2. what should i do now a lexer? what a compiler does first??? what is its pipeline
  3. yeah ive found a usefull site on that regard: Compiler pipeline
  4. first step: do the lexer.
  5. should i create a separate file just for the lexer? yea probably:
  6. NEW FILES: ./src/Lexer.h && ./src/Lexer.c
  7. [2] should i make this a Tstr[1] or just char*?
  8. Token struct created.
  9. {TRAIN} how could i make a dynamic array for ANY type of data? idk
  10. yeah gonna do the generic dynamic array tomorrow.
[1]: Tstr is the string object in the Train library;
[2]: in the token struct,there is the "item" of it which is a string,but i couldnt figure if i should make it this Tstr because (i think) it will not be changed.


0 Kudos

Comments

Displaying 2 of 2 comments ( View all | Add Comment )

knlrvr

knlrvr's profile picture

Made an account just to say thanks for the shoutout! Super excited to keep up with what you're doing here!


Report Comment

Naburgondux

Naburgondux's profile picture

Bruh o forgot to put the code,when I got on my computer I will post it here.

If you can follow my blog too to see more of this!


Report Comment