MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / generate

Method generate

extern/cloop/src/cloop/Action.cpp:37–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36
37void IfThenElseAction::generate(const ActionParametersBlock& apb, unsigned ident)
38{
39 switch(apb.language)
40 {
41 case LANGUAGE_C:
42 case LANGUAGE_CPP:
43 identify(apb, ident);
44 fprintf(apb.out, "if (%s) {\n", exprIf->generate(apb.language, apb.prefix).c_str());
45 actThen->generate(apb, ident + 1);
46 identify(apb, ident);
47 fprintf(apb.out, "}\n");
48 if (actElse)
49 {
50 identify(apb, ident);
51 fprintf(apb.out, "else {\n");
52 actElse->generate(apb, ident + 1);
53 identify(apb, ident);
54 fprintf(apb.out, "}\n");
55 }
56 break;
57
58 case LANGUAGE_PASCAL:
59 identify(apb, ident);
60 fprintf(apb.out, "if %s then begin\n", exprIf->generate(apb.language, apb.prefix).c_str());
61 actThen->generate(apb, ident + 1);
62 identify(apb, ident);
63 fprintf(apb.out, "end\n");
64 if (actElse)
65 {
66 identify(apb, ident);
67 fprintf(apb.out, "else begin\n");
68 actElse->generate(apb, ident + 1);
69 identify(apb, ident);
70 fprintf(apb.out, "end\n");
71 }
72 break;
73 }
74}
75
76
77void CallAction::generate(const ActionParametersBlock& apb, unsigned ident)

Callers

nothing calls this directly

Calls 5

identifyFunction · 0.70
c_strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected