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 }
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