如何将 Algol 68 Genia 语言转换为 c++语言
建议我如何将以下代码更改为 C++ 代码:
ROOTPROC VarUse
PROC VarUse
ROOT Cfile;
1 {
2 [
3 (?NameRef
4 (IF (AND (HAS-TYPE $parent Assignment) (IS-EQUAL $slot ``lhs''))
5 (THEN (PRINT stdout "Variable %s defined at %s" $token $location))
6 (ELSE (PRINT stdout "Name %s accessed at %s" $token $location))))]
7 }
Suggest me on how to change the following code into c++ code:
ROOTPROC VarUse
PROC VarUse
ROOT Cfile;
1 {
2 [
3 (?NameRef
4 (IF (AND (HAS-TYPE $parent Assignment) (IS-EQUAL $slot ``lhs''))
5 (THEN (PRINT stdout "Variable %s defined at %s" $token $location))
6 (ELSE (PRINT stdout "Name %s accessed at %s" $token $location))))]
7 }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然这个代码是“Algol 68 Genie”。这段代码并不完整,但从表面上看,它必须等于下一个 C++ 代码:
像 HAS-TYPE 这样的表达式没有直接的类似物。有关此语言的更多信息,请参阅 Algol 68 Genie
Apparently this code is "Algol 68 Genie". This code is not complete, but on the face of it must be equal next c++ code:
Expressions like HAS-TYPE not have direct analogue. More about this language is written in the Algol 68 Genie