Talk:Compiler/syntax analyzer: Difference between revisions

 
(One intermediate revision by one other user not shown)
Line 36:
 
I hope it's acceptable to instead use a 'Putc' node type for the putc operation. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 01:20, 21 January 2022 (UTC)
 
The three printing nodes types are:
*Prtc -- prints a character
*Prts -- prints a string
*Prti -- prints an integer
 
I used putc() for printing characters, because that is what C using.
For a Rosetta code task, adding printf() would have been too big, and puts() (from C) adds a newline, which I did not want.
So, I settled on putc() and print().
Of course, you are free to implement however you like, but it make not work with other implementations, e.g., you can intermix the C and Pything modules, because they use the same external names.
--[[User:Ed Davis|Ed Davis]] ([[User talk:Ed Davis|talk]]) 17:55, 21 January 2021 (UTC)
 
:And, I see that the vm implementation specifies a prtc instruction. So I guess I should go with that throughout. Thanks. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 17:16, 29 January 2022 (UTC)
6,951

edits