Skip to main content

module lang::cpp::ASTgen

rascal-0.40.17
clair-0.13.1

Java code generator used to bootstrap the mapping from CDT to Rascal data types.

Usage

import lang::cpp::ASTgen;

Source code

http://github.com/usethesource/clair/blob/main/src/lang/cpp/ASTgen.rsc

Dependencies

import lang::cpp::AST;
import lang::cpp::M3;
import lang::cpp::TypeSymbol;
import Type;
import List;
import String;
import IO;

function generate

void generate()

str generate(str apiName, list[type[value]] types)

function declareType

str declareType(adt(str name, list[Symbol] _), Production choice)

function declareConstructor

str declareConstructor(Production::cons(label(str cname, Symbol _), list[Symbol] args, list[Symbol] _ /*kwTypes*/, set[Attr] _), str typeName)

function type2FactoryCall

str type2FactoryCall(Symbol t)

function typeList2FactoryVarArgs

str typeList2FactoryVarArgs(list[Symbol] tss)

function typeList2FactoryVarArgsFirstPos

str typeList2FactoryVarArgsFirstPos(list[Symbol] tss)

function toExtraArgs

str toExtraArgs(list[str] strs)

function typeNameTuples2FactoryCallArgs

str typeNameTuples2FactoryCallArgs(list[Symbol] args)

function declareMakers

str declareMakers(adt(str _, list[Symbol] _), set[Production] cs)

function hasDecl

bool hasDecl("Declarator", str _)

bool hasDecl("DeclSpecifier", "declSpecifier")

bool hasDecl("DeclSpecifier", str _)

bool hasDecl("Declaration", str cname)

bool hasDecl("Expression", str cname)

bool hasDecl("Statement", str cname)

bool hasDecl("Name", "qualifiedName")

bool hasDecl("Name", "templateId")

bool hasDecl(str _, str _)

function hasTyp

bool hasTyp("Expression", str cname)

bool hasTyp("Name", "conversionName")

default bool hasTyp(str _, str _)

function hasAttrs

bool hasAttrs("Declarator", str cname)

bool hasAttrs("DeclSpecifier", str cname)

bool hasAttrs("Declaration", str cname)

bool hasAttrs("Expression", "arrayModifier")

bool hasAttrs("Statement", str cname)

default bool hasAttrs(_, _)

function declareMaker

str declareMaker(Production::cons(label(str cname, Symbol typ:adt(str typeName, list[Symbol] _)), list[Symbol] args, list[Symbol] _ /*kwTypes*/,set[Attr] _))

function declareConsArgs

str declareConsArgs(list[Symbol] args)

function callConsArgs

str callConsArgs( list[Symbol] args)

function argToSimpleJavaArg

str argToSimpleJavaArg(str l, Symbol t)

function typeToSimpleJavaType

str typeToSimpleJavaType(Symbol t)

function javaResult

str javaResult(Symbol t, str access)

function typeToJavaType

str typeToJavaType(Symbol t)