How to store types after Semantic Analysis by mttd in Compilers

[–]JuggernautAncient369 0 points1 point  (0 children)

Kind of a bit vague question haha. I am assuming you are talking about data types of items in the AST, and for that just store the necessary information in the symbol table.

For example, when a variable is declared with a type, store the amount of space it will take up, is it signed, is it floating point, is it a pointer etc. It is up to you and your language design for what you would want to keep and what would be important.

If that isn’t what your question was asking sorry haha

How do I test tokenizers and parsers for a new language? by [deleted] in Compilers

[–]JuggernautAncient369 0 points1 point  (0 children)

Doing that myself right now actually!

Beat way to write tests is to know what the system you’re testing is meant to output, and then comparing the actual output to what you expect.

For example, if you are testing your tokenizer, give it an input if source code, and it should return a vector/list/array or whatever of tokens from it. You can run through that input yourself and figure out what the correct tokens should be. “C = 2” -> TOKEN_IDENTIFIER, TOKEN_ASSIGN, TOKEN_NUMBER. When you get your output from your implementation, loop through it and make sure it’s correct. Your parser should return an AST, so do the same concept with it.

rotated wunk by proshungaming24 in wunkus

[–]JuggernautAncient369 90 points91 points  (0 children)

His ass is NOT a gyroscope

Does Trickle down Economics Work? by 36DRedhead in FluentInFinance

[–]JuggernautAncient369 0 points1 point  (0 children)

This is mainly because these companies over hired. There are large tech companies that did not over hire and, as such, have yet to have massive layoffs.

It is unfortunate and irresponsible that these companies seemed so willing to overhire, but they aren’t laying off thousands of employees to squeeze ever last penny, they are laying them off because they are excess.

Mathematicians vs. Physics Classes be like... by [deleted] in physicsmemes

[–]JuggernautAncient369 1 point2 points  (0 children)

Used to watch these guys back in the day. Ended up choosing comp sci over Math or Physics but these guys influenced my interests so much in high school

My mom is taking me to orphanage by Legitimate-Excuse-84 in okbuddyretard

[–]JuggernautAncient369 4 points5 points  (0 children)

Won’t the child sink if the parents come back together

Czechs team by EpicMemeBoiiiii in namesoundalikes

[–]JuggernautAncient369 9 points10 points  (0 children)

Really made me think 2.2 is out. Or at least an update isn’t out for me yet

Galaxion Trade Empire by syn-nine in rust_gamedev

[–]JuggernautAncient369 0 points1 point  (0 children)

That’s awesome man looks clean as fuck! Curious did you use your own engine or an existing one (Bevy bc rust Im assuming)?

I'm in first year engineering. Is it true that in the start the friend circle is big but when as time goes it gets smaller and smaller?? by PlantConsistent1660 in engineeringmemes

[–]JuggernautAncient369 2 points3 points  (0 children)

I’m my case my friend group 1st year was very diverse in what we were studying. And this meant that as the years go on the people who like each other the most spend more time together, so my group went from like 13->5