Skip to content

Commit

Permalink
- Added getAstAsCorbaString(filename) API call.
Browse files Browse the repository at this point in the history
  + It prints the string to file and returns a boolean instead of a really long string.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4793 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 18, 2010
1 parent 8e6439d commit 08650f4
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Compiler/Interactive.mo
Expand Up @@ -1505,9 +1505,31 @@ algorithm
functionArgs = Absyn.FUNCTIONARGS(args = {},argNames = {})))}),
st as SYMBOLTABLE(ast = p, explodedAst = s))
equation
(top_names_str) = Dump.getAstAsCorbaString(p);
Dump.getAstAsCorbaString(p);
top_names_str = Print.getString();
Print.clearBuf();
then
(top_names_str, st);

/* Print the whole AST to file */
case (ISTMTS(interactiveStmtLst =
{IEXP(exp = Absyn.CALL(function_ = Absyn.CREF_IDENT(name = "getAstAsCorbaString"),
functionArgs = Absyn.FUNCTIONARGS(args = {Absyn.STRING(filename)},argNames = {})))}),
st as SYMBOLTABLE(ast = p, explodedAst = s))
equation
Dump.getAstAsCorbaString(p);
Print.writeBuf(filename);
Print.clearBuf();
then
("true", st);

/* Failed to print the whole AST to file */
case (ISTMTS(interactiveStmtLst =
{IEXP(exp = Absyn.CALL(function_ = Absyn.CREF_IDENT(name = "getAstAsCorbaString"),
functionArgs = Absyn.FUNCTIONARGS(args = {Absyn.STRING(filename)},argNames = {})))}),
st as SYMBOLTABLE(ast = p, explodedAst = s))
then
("false", st);

/* adrpo added 2008-11-28 deal with the annotation versions */
case (ISTMTS(interactiveStmtLst =
Expand Down

0 comments on commit 08650f4

Please sign in to comment.