airuno,
Here is how mastercam works:
An NCI file is generated by the software which contains tool, cycle and cutter location information. The file is set out as follows:
CYCLE
PARAMETERS
For example, a rapid move would be defined by the following 2 lines:
0
10.5 3.8 1 0
In this example, the first line contains a zero which defines that the following parameters are for a rapid move. The second line contains the rapid move parameters: x position, z position, cutter comp, move angle.
The post processor merely needs to have a databse of all the cycle numbers and what parameters each one requires. Converting this into G-code is then straightforward.