Clownfish-CFC
view release on metacpan or search on metacpan
charmonizer.c view on Meta::CPAN
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Source fragment for the Clownfish compiler's charmonizer.c.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* #include "Charmonizer/Probe.h" */
/* #include "Charmonizer/Probe/Integers.h" */
typedef struct SourceFileContext {
chaz_MakeBinary *core_binary;
lemon/lemon.c view on Meta::CPAN
psp->state = WAITING_FOR_DECL_KEYWORD;
}else if( ISLOWER(x[0]) ){
psp->lhs = Symbol_new(x);
psp->nrhs = 0;
psp->lhsalias = 0;
psp->state = WAITING_FOR_ARROW;
}else if( x[0]=='{' ){
if( psp->prevrule==0 ){
ErrorMsg(psp->filename,psp->tokenlineno,
"There is no prior rule upon which to attach the code "
"fragment which begins on this line.");
psp->errorcnt++;
}else if( psp->prevrule->code!=0 ){
ErrorMsg(psp->filename,psp->tokenlineno,
"Code fragment beginning on this line is not the first "
"to follow the previous rule.");
psp->errorcnt++;
}else if( strcmp(x, "{NEVER-REDUCE")==0 ){
psp->prevrule->neverReduce = 1;
}else{
psp->prevrule->line = psp->tokenlineno;
psp->prevrule->code = &x[1];
psp->prevrule->noCode = 0;
}
}else if( x[0]=='[' ){
modules/CommonMark/src/cmark.h view on Meta::CPAN
* A generalization of `cmark_parser_new_with_mem`:
* ```c
* cmark_parser_new_with_mem(options, mem)
* ```
* is approximately the same as:
* ```c
* cmark_parser_new_with_mem_into_root(options, mem, cmark_node_new(CMARK_NODE_DOCUMENT))
* ```
*
* This is useful for creating a single document out of multiple parsed
* document fragments.
*/
CMARK_EXPORT
cmark_parser *cmark_parser_new_with_mem_into_root(
int options, cmark_mem *mem, cmark_node *root);
/** Frees memory allocated for a parser object.
*/
CMARK_EXPORT
void cmark_parser_free(cmark_parser *parser);
modules/CommonMark/src/cmark.h view on Meta::CPAN
/**
* ## Rendering
*/
/** Render a 'node' tree as XML. It is the caller's responsibility
* to free the returned buffer.
*/
CMARK_EXPORT
char *cmark_render_xml(cmark_node *root, int options);
/** Render a 'node' tree as an HTML fragment. It is up to the user
* to add an appropriate header and footer. It is the caller's
* responsibility to free the returned buffer.
*/
CMARK_EXPORT
char *cmark_render_html(cmark_node *root, int options);
/** Render a 'node' tree as a groff man page, without the header.
* It is the caller's responsibility to free the returned buffer.
*/
CMARK_EXPORT
src/CFCBindClass.h view on Meta::CPAN
* class's interface: all method invocation functions, etc...
*/
char*
CFCBindClass_to_c_header(CFCBindClass *self);
/** Return the C data definitions necessary for the class to function properly.
*/
char*
CFCBindClass_to_c_data(CFCBindClass *self);
/** Return host-specific data for the class as JSON fragment.
*/
char*
CFCBindClass_host_data_json(CFCBindClass *self);
#ifdef __cplusplus
}
#endif
#endif /* H_CFCBINDCLASS */
src/CFCBindMethod.h view on Meta::CPAN
*/
char*
CFCBindMeth_abstract_method_def(struct CFCMethod *method,
struct CFCClass *klass);
/** Return C code declaring the function which implements a method.
*/
char*
CFCBindMeth_imp_declaration(struct CFCMethod *method, struct CFCClass *klass);
/** Return a JSON fragment for method data specified by the host bindings
* (alias or excluded).
*/
char*
CFCBindMeth_host_data_json(struct CFCMethod *method);
#ifdef __cplusplus
}
#endif
#endif /* H_CFCBINDMETHOD */
src/CFCGoTypeMap.c view on Meta::CPAN
}
}
return NULL;
}
char*
CFCGoTypeMap_go_short_package(CFCParcel *parcel) {
// The Go short package name is the last component of the dot-separated
// Clownfish parcel name.
const char *parcel_frag = strrchr(CFCParcel_get_name(parcel), '.');
if (parcel_frag) {
parcel_frag += 1;
}
else {
parcel_frag = CFCParcel_get_name(parcel);
}
// TODO: Don't downcase package name once caps are forbidden in Clownfish
// parcel names.
char *go_short_package = CFCUtil_strdup(parcel_frag);
for (int i = 0; go_short_package[i] != '\0'; i++) {
go_short_package[i] = CFCUtil_tolower(go_short_package[i]);
}
return go_short_package;
}
void
CFCGoTypeMap_go_meth_receiever(const char *struct_name,
CFCParamList *param_list,
src/CFCPerlTypeMap.h view on Meta::CPAN
#ifndef H_CFCPERLTYPEMAP
#define H_CFCPERLTYPEMAP
#ifdef __cplusplus
extern "C" {
#endif
/** Clownfish::CFC::Binding::Perl::TypeMap - Convert between Clownfish and
* Perl via XS.
*
* TypeMap serves up C code fragments for translating between Perl data
* structures and Clownfish data structures. The functions to_perl() and
* from_perl() achieve this for individual types; write_xs_typemap() exports
* all types using the XS "typemap" format documented in "perlxs".
*/
struct CFCHierarchy;
struct CFCType;
/** Return an expression which converts from a Perl scalar to a variable of
* the specified type.
( run in 1.000 second using v1.01-cache-2.11-cpan-364913b4093 )