Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

  Image Modified


An -based Project.

...

Call host code functions with dependency analysis. Use angle brackets to point to an extern function. You can also declare extern variables.

Column
width50%
Code Block
languagesct
linenumberstrue
@hostcode "#include <stdio.h>"
@hostcode "#include <stdlib.h>"
scchart MainSCChartfunctionCall {
  output int i;
  extern int stdout;
 
Column
width50%
 Image Removed Image Removed
 
  initial state getChar {
    entry / <printf("Enter an integer: ")>;
    entry / <fflush( stdout )>;
    entry / <scanf("%d", &i)>;
  }
  --> print with / <printf("The interger you entered: %d\\n", i)>; 
  				   <fflush( stdout )>;
  
  state print 
  --> getChar;
} 
Column
width50%

  Image Added


Hostcode (inline)

...