Change generated code

I am wrapping a C ++ library in PHP using SWIG , and there have been times when I want to modify the generated code (both generated C ++ and PHP):

  • Fix code generation errors
  • Add code that makes sense in PHP but not in C ++ (e.g. type checking)
  • Add documentation tags (e.g. phpDoc)

I am currently automating these changes with patch. This approach works, but it seems very technical and fragile. Is there a better way to do this?

+3
source share
3 answers

, . . , .

, . , , , , .

, , .

, , , . , . , .

!

+1

, . SWIG , :

  • ( )
  • . .

, , . , . .

...

+1

- , , , . , , PHP OO, Gap Generation.

+1

Source: https://habr.com/ru/post/1760144/


All Articles