If the line with the rpc statement is not there, we get a segfault in
main.cpp:144: ccst_caller_h->write(ofs_caller_h, 0);
while giving no rpcs is okay with the grammer (Rpc*), the code
does not handle such a case. It always expects rpcs.
We see that no type definitions are found in the scope (which results in 0 rpcs) for the rpc's scope, which results in termination Wof the program. Need to see how we traverse from scope to scope during the ccst generation process. hile it is true rpcs do not exist in the parent scope of the require statement, it does exist inside the projection scope. Why are we not being able to pick that up??
2. Resolved - Does not detect an rpc, when require is put.
The following issue has been resolved. The problem was the rule for Interface was of the form X --> A|B in the peg grammar, where the IDL was matching B and not A. What was happening was that parts of A was being matched, and the code was being generated for the parts that were matched, even though the entire A did not match with input IDL. Then when B was matched, the corresponding code for B was also generated. In the implementation this resulted in Module class being created twice, and hence this created a problem in referencing the scopes correctly.
Fix - Make the rule for Interface in peg of the form X --> A, such that A has the require grammar itself.