-
Notifications
You must be signed in to change notification settings - Fork 25
Pointer
Olivier Smedile edited this page Feb 22, 2018
·
3 revisions
In Cobol 85 pointers, cannot be incremented or decremented by a numeric variable (like in C for example).
TypeCobol allow you to use the syntax :
SET MyPointer UP BY n
SET MyPointer UP BY 1
SET MyPointer DOWN BY n
SET MyPointer DOWN BY 1
Where:
-
MyPointer
is apointer
-
n
is a numeric variable
If a pointer is used that way, the code generation must add a redefines to the pointer like this:
01 MyPointer pointer.
01 MyPointer-HASH redefines MyPointer pic 9(05) comp-5.
- POINTER_SET_UP_BY standard pointer of Cobol 85 declared in level 01 to 49 can be use in instruction
SET UP BY
andSET DOWN BY
like index.- Forbird this syntax for pointer declared in level 77
- POINTER_CGEN_DECLARATION if a pointer is used in a
SET UP/DOWN BY
, then it's declaration is redefined.- The name of the redefines, is the 22 first characters of the pointer followed by a hash of 8 characters of the unique name of the pointer. This name is named
redefinedPtrName
. - The picture clause is
pic 9(05) comp-5
- The name of the redefines, is the 22 first characters of the pointer followed by a hash of 8 characters of the unique name of the pointer. This name is named
- POINTER_CGEN_USAGE the instruction
SET ptr UP BY n
is translated toADD n to redefinedPtrName
Introduction
TypeCobol language
-
In a nutshell
-
TypeCobol concepts
TypeCobol Editor
(Type)Cobol parser API
TypeCobol architecture
- Glossary
- Main phases
- How to extend the grammar and semantic check (full example)
- File
- Text
- Code analysis steps
- Program class parser
- Type checker
- Error handler
- Grammars Composition
- Code generation
- Compilation process
(Type)Cobol concepts / reference doc
Contributing