buzz_toolset

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
buzz_toolset [2016/04/16 05:02]
ilpincy [CMake Support]
buzz_toolset [2016/09/03 00:28] (current)
ilpincy
Line 11: Line 11:
  
 The fourth tool, called ''bzzdeasm'', produces an annotated assembly file from the bytecode and the debug information. The fourth tool, called ''bzzdeasm'', produces an annotated assembly file from the bytecode and the debug information.
 +
 +==== bzzc ====
 +
 +<code bash>
 +$ bzzc [options] <file.bzz>
 +</code>
 +
 +This command combines ''bzzparse'' and ''bzzasm''. It takes as input a script ''file.bzz'' and produces two files: ''file.bo'' (the bytecode file), and ''file.bdb'' (the debugging information file).
 +
 +''bzzc'' honors ''BUZZ_INCLUDE_PATH'' like ''bzzparse''.
 +
 +In addition, it is possible to specify the path of ''bzzparse'' and ''bzzasm'' with the environment variables ''BZZPARSE'' and ''BZZASM'', respectively. This is usually not necessary, as ''bzzc'' looks for these paths automatically. This feature was added to make seamless support of automated build systems like [[https://cmake.org/|CMake]] possible.
 +
 +The ''bzzc'' command accepts the following options:
 +
 +  * ''-I|%%--%%include path1:path2:...:pathN'': specifies a list of include paths to append to ''BUZZ_INCLUDE_PATH''
 +  * ''-b|%%--%%bytecode file.bo'': specifies an explicit name for the bytecode file
 +  * ''-d|%%--%%debug file.bdb'': specifies an explicit name for the debugging information file
 +  * ''-h|%%--%%help'': shows help on the command line
  
 ==== bzzparse ==== ==== bzzparse ====
Line 33: Line 52:
 This command compiles a Buzz [[buzz_assembler|assembly code]] file ''infile.basm'' and produces two output files. The first, ''outfile.bo'', is the bytecode to be executed by the [[buzz_vm|Buzz Virtual Machine]]. The second, ''outfile.bdb'', is a binary file containing debugging information. This command compiles a Buzz [[buzz_assembler|assembly code]] file ''infile.basm'' and produces two output files. The first, ''outfile.bo'', is the bytecode to be executed by the [[buzz_vm|Buzz Virtual Machine]]. The second, ''outfile.bdb'', is a binary file containing debugging information.
  
-==== bzzc ====+==== bzzdeasm ====
  
 <code bash> <code bash>
-bzzc [options] <file.bzz>+bzzdeasm <infile.bo> <infile.bdb> <outfile.basm>
 </code> </code>
  
-This command combines ''bzzparse'' and ''bzzasm''. It takes as input a script ''file.bzz'' and produces two files: ''file.bo'' (the bytecode file), and ''file.bdb'' (the debugging information file). +This tool takes as input a bytecode file ''infile.bo'' and the corresponding debugging information file ''infile.bdb'', and produces an [[buzz_assembler|assembly code]] file ''outfile.basm''
- +==== bzzrun ====
-''bzzc'' honors ''BUZZ_INCLUDE_PATH'' like ''bzzparse''+
- +
-In additionit is possible to specify the path of ''bzzparse'' and ''bzzasm'' with the environment variables ''BZZPARSE'' and ''BZZASM'', respectively. This is usually not necessary, as ''bzzc'' looks for these paths automatically. This feature was added to make seamless support of automated build systems like [[https://cmake.org/|CMake]] possible. +
- +
-The ''bzzc'' command accepts the following options: +
- +
-  * ''-I|%%--%%include path1:path2:...:pathN'': specifies a list of include paths to append to ''BUZZ_INCLUDE_PATH'' +
-  * ''-b|%%--%%bytecode file.bo'': specifies an explicit name for the bytecode file +
-  * ''-d|%%--%%debug file.bdb'': specifies an explicit name for the debugging information file +
-  * ''-h|%%--%%help'': shows help on the command line +
-==== bzzdeasm ====+
  
 <code bash> <code bash>
-bzzdeasm <infile.bo> <infile.bdbg> <outfile.basm>+bzzrun [--trace] file.bo file.bdb
 </code> </code>
  
-This tool takes as input a bytecode file ''infile.bo'' and the corresponding debugging information file ''infile.bdbg''and produces an [[buzz_assembler|assembly code]] file ''outfile.basm''.+This is simple interpreter that executes the given Buzz bytecode file ''file.bo''Its main purpose is to provide a starting point for projects that [[buzz_c_cpp|integrate Buzz as extension language]]. 
 + 
 +As suchthe [[https://github.com/MISTLab/Buzz/blob/master/src/buzz/buzzrun.c|source code of ''bzzrun'']] is more interesting than what the command actually does. ''bzzrun'' can also be used as a simple interpreter for standalone Buzz scripts that do not use any messaging (e.g., neighbors, groups, virtual stigmergy, etc.).
  
 ==== CMake Support ==== ==== CMake Support ====
Line 67: Line 77:
 You have two ways to let CMake find the modules. You have two ways to let CMake find the modules.
  
-The first is to set the variable ''CMAKE_MODULE_PATH'' to ''$PREFIX/share/buzz/cmake'' somewhere in your ''CMakeLists.txt'' file. This will instruct CMake to go look for these modules in that directory. Assuming ''$PREFIX'' is ''/usr/local'', you could write: +The first way is to set the variable ''CMAKE_MODULE_PATH'' to ''$PREFIX/share/buzz/cmake'' somewhere in your ''CMakeLists.txt'' file. This will instruct CMake to go look for these modules in that directory. Assuming ''$PREFIX'' is ''/usr/local'', you could write: 
-<code>+<code cmake>
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/local/share/buzz/cmake) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/local/share/buzz/cmake)
 </code> </code>
  
-The second is to symlink the modules directly into the CMake distribution. Assuming CMake was installed in ''/usr/local'', type:+The second way to let CMake find the Buzz modules is to symlink the modules directly into the CMake distribution. Assuming CMake was installed in ''/usr/local'', type:
 <code bash> <code bash>
 $ cd /usr/local/share/cmake/Modules $ cd /usr/local/share/cmake/Modules
-$ ln -s /usr/local/share/buzz/cmake/FindBuzz.cmake +sudo ln -s /usr/local/share/buzz/cmake/FindBuzz.cmake 
-$ ln -s /usr/local/share/buzz/cmake/UseBuzz.cmake+sudo ln -s /usr/local/share/buzz/cmake/UseBuzz.cmake
 </code> </code>
  
 === Using the Modules === === Using the Modules ===
  
-Two modules exist: the first, ''FindBuzz.cmake'', looks for Buzz tools, libraries, and headers. The second, ''UseBuzz.cmake'', defines the command ''make_buzz()'', which tells CMake how to compile a Buzz script.+Two modules exist: the first, ''FindBuzz.cmake'', looks for Buzz tools, libraries, and headers. The second, ''UseBuzz.cmake'', defines the command ''buzz_make()'', which tells CMake how to compile a Buzz script.
  
 If you intend to use Buzz, you must include a call to both modules in your ''CMakeLists.txt'' file. You can do this in many ways, but the two most common use cases are the following. If you intend to use Buzz, you must include a call to both modules in your ''CMakeLists.txt'' file. You can do this in many ways, but the two most common use cases are the following.
  
 == 1. Buzz is a required tool in your project == == 1. Buzz is a required tool in your project ==
-<code> +<code cmake>
-...+
 # Look for Buzz tools, libraries, and headers # Look for Buzz tools, libraries, and headers
 find_package(Buzz REQUIRED) find_package(Buzz REQUIRED)
Line 93: Line 102:
 include(UseBuzz) include(UseBuzz)
 # Compile a script that does not include any other script # Compile a script that does not include any other script
-make_buzz(script1.bzz)+buzz_make(script1.bzz)
 # Compile a script that includes dep1.bzz and dep2.bzz # Compile a script that includes dep1.bzz and dep2.bzz
-make_buzz(script2.bzz DEPENDENCIES dep1.bzz dep2.bzz)+buzz_make(script2.bzz INCLUDES dep1.bzz dep2.bzz)
 </code> </code>
  
 == 2. Buzz is an optional tool in your project == == 2. Buzz is an optional tool in your project ==
-<code> +<code cmake>
-...+
 # Look for Buzz tools, libraries, and headers # Look for Buzz tools, libraries, and headers
 find_package(Buzz) find_package(Buzz)
Line 107: Line 115:
   include(UseBuzz)   include(UseBuzz)
   # Compile a script that does not include any other script   # Compile a script that does not include any other script
-  make_buzz(script1.bzz) +  buzz_make(script1.bzz) 
-  # Compile a script that includes dep1.bzz and dep2.bzz +  # Compile a script that includes inc1.bzz and inc2.bzz 
-  make_buzz(script2.bzz DEPENDENCIES dep1.bzz dep2.bzz)+  buzz_make(script2.bzz INCLUDES inc1.bzz inc2.bzz)
 endif(BUZZ_FOUND) endif(BUZZ_FOUND)
 </code> </code>
  • buzz_toolset.1460782922.txt.gz
  • Last modified: 2016/04/16 05:02
  • by ilpincy