Пример #1
0
static PT_Tree addBoxToTextFunction(PT_ParseTree parseTree)
{
  PT_Tree newTree = NULL;

  if (PT_isValidParseTree(parseTree)) 
  {
    PT_Tree ptBox = PT_getParseTreeTree(parseTree);

    newTree = PT_applyFunctionToTree("box2text", "Text", 1, ptBox);
  }
  else 
  {
    ATerror("addBoxToTextFunction: not a proper parse tree: %t\n",
	    (ATerm) parseTree);
    return (PT_Tree) NULL;
  }
  return newTree;
}
Пример #2
0
static PT_Tree addEqsSyntaxFunction(const char *name, PT_ParseTree parseTree)
{
  SDF_ModuleName sdfModuleName = SDF_makeModuleName(name);
  PT_Tree ptModuleName = PT_TreeFromTerm(SDF_ModuleNameToTerm(sdfModuleName));
  PT_Tree newTree = NULL;

  if (PT_isValidParseTree(parseTree)) {
    PT_Tree ptSyntax = PT_getParseTreeTree(parseTree);

    newTree = PT_applyFunctionToTree("add-equation-module",
				     "SDF",
				     2,
				     ptModuleName,
				     ptSyntax);

  } 
  else {
    ATerror("add_eqs_syntax: not a proper parse tree: %t\n", (ATerm) parseTree);
    return (PT_Tree) NULL;
  }

  return newTree;
}