Skip to content

Commit

Permalink
- this change is to enable querying of Modelica Standard Library 3.2 …
Browse files Browse the repository at this point in the history
…which has a class called Code.

- changed Code quoting to use $Code in Parser/BaseModelica_Lexer.g
  + allow $Code in END_IDENT token (to be able to use type $Code end $Code; in ModelicaBuiltin.mo).
  + changes in Compiler/FrontEnd/ModelicaBuiltin.mo to use $Code instead of Code.
  + documentation updates in doc/OpenModelicaAPI-Howto/OMC_API-HowTo.tex and doc/OpenModelicaUsersGuide.doc
  + changes to Compiler/FrontEnd/Dump.mo to dump CodeNode using $Code.
  + changes everywhere where Code was used to use $Code (.mo, .mos, .onb, .c*)
  + updated OMEdit and OMOptim to use $Code.
  + more interactive tests in testsuite/interactive/interactive_api_calls.mos (from doc/OpenModelicaAPI-Howto/OMC_API-HowTo.tex)
  + show statements in more testsuite/interactive tests.
  + update the Parser/omcc/* files 
- removed testsuite/HumMod directory
- removed doc/OpenModelica-TortoiseSVN+Putty-HOWTO.doc as is way old and not useful anymore.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk/doc@12204 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Jun 25, 2012
1 parent cd4907c commit eeaf1d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Binary file removed OpenModelica-TortoiseSVN+Putty-HOWTO.doc
Binary file not shown.
Binary file modified OpenModelicaAPI-Howto/OMC_API-HowTo.pdf
Binary file not shown.
26 changes: 13 additions & 13 deletions OpenModelicaAPI-Howto/OMC_API-HowTo.tex
Expand Up @@ -30,7 +30,7 @@
\begin{document}


What follows is a list of the OMC APIs with their syntax and examples.
What follows is a list of the OMC APIs with their syntax and examples. See also testsuite/interactive/* for more examples.

\begin{modelicaExamples}
% Standard API
Expand Down Expand Up @@ -544,7 +544,7 @@
\tab end mymodel;\\
end test;\\
\end{mocode}
\functionex{addComponent(c1, Modelica.Electrical.Analog.Basic.Capacitor, test.mymodel, annotate=Code(()))}
\functionex{addComponent(c1, Modelica.Electrical.Analog.Basic.Capacitor, test.mymodel, annotate=\$Code(()))}
{true}

\begin{mocode}
Expand Down Expand Up @@ -676,9 +676,9 @@
end test;\\
\end{mocode}
\functionex{getNthComponentModification(test.mymodel, 1)}
{\{Code()\}}
{\{\$Code()\}}

\functionex{setComponentModifierValue(test.mymodel, r1, Code(=2))}
\functionex{setComponentModifierValue(test.mymodel, r1, \$Code(=2))}
{Ok}

\begin{mocode}
Expand All @@ -687,17 +687,17 @@
\dots \\
\end{mocode}
\functionex{getNthComponentModification(test.mymodel, 1)}
{\{Code(=2)\}}
{\{\$Code(=2)\}}

\functionex{setComponentModifierValue(test.mymodel, r1.start, Code(=2))}
\functionex{setComponentModifierValue(test.mymodel, r1.start, \$Code(=2))}
{Ok}

\begin{mocode}
\dots \\
Modelica.Electrical.Analog.Basic.Resistor r1(start=2)=2;\\
\dots \\
\end{mocode}
\functionex{setComponentModifierValue(test.mymodel, r1, Code(=Resistor(R=2)))}
\functionex{setComponentModifierValue(test.mymodel, r1, \$Code(=Resistor(R=2)))}
{Ok}

\begin{mocode}
Expand All @@ -706,9 +706,9 @@
\dots \\
\end{mocode}
\functionex{getNthComponentModification(test.mymodel, 1)}
{\{Code((start=2)=Resistor(R=2))\}}
{\{\$Code((start=2)=Resistor(R=2))\}}

\functionex{setComponentModifierValue(test.mymodel, r1.min, Code(=10))}
\functionex{setComponentModifierValue(test.mymodel, r1.min, \$Code(=10))}
{Ok}

\begin{mocode}
Expand All @@ -720,7 +720,7 @@
{\{start, min\}}

\functionex{getNthComponentModification(test.mymodel, 1)}
{\{Code((start=2, min=10)=Resistor(R=2))\}}
{\{\$Code((start=2, min=10)=Resistor(R=2))\}}

\functionex{getComponentModifierValue(test.mymodel, r1)}
{Resistor(R=2)}
Expand All @@ -731,23 +731,23 @@
\functionex{getComponentModifierValue(test.mymodel, r1.min)}
{=10}

\functionex{setComponentModifierValue(test.mymodel, r1.min, Code(()))}
\functionex{setComponentModifierValue(test.mymodel, r1.min, \$Code(()))}
{Ok}

\begin{mocode}
\dots \\
Modelica.Electrical.Analog.Basic.Resistor r1(start=2)=Resistor(R=2);\\
\dots \\
\end{mocode}
\functionex{setComponentModifierValue(test.mymodel, r1, Code(()))}
\functionex{setComponentModifierValue(test.mymodel, r1, \$Code(()))}
{Ok}

\begin{mocode}
\dots \\
Modelica.Electrical.Analog.Basic.Resistor r1(start=2);\\
\dots \\
\end{mocode}
\functionex{setComponentModifierValue(test.mymodel, r1.start, Code(()))}
\functionex{setComponentModifierValue(test.mymodel, r1.start, \$Code(()))}
{Ok}

\begin{mocode}
Expand Down

0 comments on commit eeaf1d7

Please sign in to comment.