![]() |
|
Tutorial CYFPL - Part 1 - Trees, trees, and more trees - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: Tutorial CYFPL - Part 1 - Trees, trees, and more trees (/Thread-Tutorial-CYFPL-Part-1-Trees-trees-and-more-trees) Pages:
1
2
|
RE: CYFPL - Part 1 - Trees, trees, and more trees - Nil - 01-02-2017 (01-02-2017, 04:15 AM)phyrrus9 Wrote:(01-02-2017, 04:12 AM)God Wrote:(01-02-2017, 03:58 AM)phyrrus9 Wrote: The uni i went to had a policy that if 7 or more students requested a class they had to teach it the following term, if you're still attending that might be something you could look into. Love you too That's true. This is your time so use it wisely. In any case, writing tutorials can help your own understanding and you can share it elsewhere also. RE: CYFPL - Part 1 - Trees, trees, and more trees - Nil - 01-02-2017 Why should you read the tree from right to left? Is that just protocol, because it seemed simpler to read it as normal from left to right. Also, what exactly does factor refer to in the larger tree? Of course I know what a factor is in mathematics but I'm not sure if this is the same thing. RE: CYFPL - Part 1 - Trees, trees, and more trees - phyrrus9 - 01-02-2017 (01-02-2017, 08:26 PM)God Wrote: Why should you read the tree from right to left? Is that just protocol, because it seemed simpler to read it as normal from left to right. Also, what exactly does factor refer to in the larger tree? Of course I know what a factor is in mathematics but I'm not sure if this is the same thing. That's my bad, you're correct it should be left to right. A factor, in the sense of this project is a parenthesized expression, a number, or a variable. It looks like in the large tree they like to use (E) form more than anything. RE: CYFPL - Part 1 - Trees, trees, and more trees - Blink - 01-02-2017 I almost didn't open this because I had no idea what CYFPL stood for, thanks for the [confusing] guide. RE: CYFPL - Part 1 - Trees, trees, and more trees - phyrrus9 - 01-02-2017 (01-02-2017, 09:28 PM)Ender Wrote: I almost didn't open this because I had no idea what CYFPL stood for, thanks for the [confusing] guide. Yeah, I did this one a little bit differently, it had an intro, which seems to have been cast into the depths of the coding section now. There is a link in my signature to the intro though if you still want to read it RE: CYFPL - Part 1 - Trees, trees, and more trees - Inori - 01-03-2017 I think I understood all of that, but just to make sure I'm missing nothing, the blank tokens in [url=https://i.stack.imgur.com/SyonV.png]this picture[/i] are just EOL-type things, right? And if so, wouldn't it save a potential bunch of stack frames to get rid of it when running it through the lexer, compiler, and everything else that's included in actually running a program? Anyway, awesome start to what I hope will be another great series! RE: CYFPL - Part 1 - Trees, trees, and more trees - phyrrus9 - 01-03-2017 (01-03-2017, 03:45 AM)Inori Wrote: I think I understood all of that, but just to make sure I'm missing nothing, the blank tokens in [url=https://i.stack.imgur.com/SyonV.png]this picture[/i] are just EOL-type things, right? And if so, wouldn't it save a potential bunch of stack frames to get rid of it when running it through the lexer, compiler, and everything else that's included in actually running a program? Yeah, the blank tokens put me at a loss as well, I assume they just indicate end of token/line, but in any case I would ignore them, the remainder of the tree grasps everything we are going to use. As far as lexing and compiling goes, we won't be storing any of this information, so we don't handle cleanup. The key here is this is a recursive parser, so everything we need will be conveniently held in stack frames and handled for us by the C ABI. RE: CYFPL - Part 1 - Trees, trees, and more trees - JzJad - 01-03-2017 Must say I fucking love your tutorials Good job as always sir.
RE: CYFPL - Part 1 - Trees, trees, and more trees - m0dem - 03-13-2017 Thank you for taking the time to write this up! Deserves a bump. RE: CYFPL - Part 1 - Trees, trees, and more trees - phyrrus9 - 03-13-2017 (03-13-2017, 08:48 PM)m0dem Wrote: Thank you for taking the time to write this up! Not a problem man! Writing these keeps my skills sharp at the same time, so always happy to |