1falcon(1)                     Falcon User Manuals                    falcon(1)
2
3
4

NAME

6       falcon - The Falcon Programming Language command line interpreter
7
8

SYNOPSIS

10       falcon [options] [main_script] [script_options]
11
12

DESCRIPTION

14       The  falcon command line interpreter is used to launch, compile, assem‐
15       ble or debug scripts written in the Falcon  Programming  Language.  The
16       command  line  interpreter pushes the core module and the rtl module in
17       the script load table, so they are available  by  default  to  all  the
18       scripts.
19
20       The default operation is that of launching the given script, or read it
21       from the standard input if the script name is not  given.  By  default,
22       falcon  saves also the compiled module of the script in the same direc‐
23       tory where it is found, changing the extension to ".fam".
24
25       The main_script can be a "logical" module name, a relative path  or  an
26       absolute  path.  In  case it's a logical module name, that is, a script
27       name without extension nor leading path, it  is  searched  through  the
28       load  path.  The  default  load  path  is determined by the compilation
29       options of the interpreter, and usually it includes the current  direc‐
30       tory.  The  environment  variable FALCON_LOAD_PATH and the command line
31       option -L can change the default module search path.
32
33       When the main module is found, its path is added to the  module  search
34       path; in other words, there isn't any need to specify the path contain‐
35       ing the main module to have other modules in its same directory to  get
36       loaded.  The main module and other source Falcon module it loads can be
37       stored in a directory that is not listed in  the  module  search  path;
38       indicating  an  absolute  or relative path as the main_script parameter
39       will add that path on top of the active search path.
40
41       If not differently specified, falcon will search for .fam modules newer
42       than  the relative .fal source scripts and will load those ones instead
43       of compiling the sources.
44
45       Options past the script name will be  directly  passed  in  the  args[]
46       global variable of the script.
47
48       The  interpreter is compatible with the UNIX script execution directive
49       "#!".  A main script can have on the very first line of  the  code  the
50       directive
51
52       #!/path/to/falcon
53
54       to  declare  to the shell that the falcon command line is to be loaded.
55       If falcon command line interpreter is also in the system PATH  environ‐
56       ment variable, which is usually the case of a normal installation, then
57       the interpreter directive may also be simply
58
59       #!/bin/env falcon
60
61       It is then simply necessary to make the main script executable with
62
63       chmod 744 script_name
64
65       to be able to call the script directly.
66
67       Scripts executed in this way will add their path to the  falcon  module
68       load  path  as  soon  as they are loade, so other modules referenced by
69       them will be searched in the directory where they resides before  being
70       searched elsewhere.
71
72       Options  to  the falcon compiler may be passed normally by writing them
73       after the execution directive in the main script.
74
75       Since version 0.8.12, the falcon command line interpreter has  also  an
76       interactive  mode  which  accepts statements and provide results as the
77       expressions are evaluated.
78
79
80

OPTIONS

82       -c     Compile but do not execute. This makes  falcon  to  compile  the
83              given  module  into a .fam file and then terminate.  By default,
84              the .fam file is written to a file with the  same  name  as  the
85              input one, with the .fam extension.
86
87       -C     Check  for  memory  leaks in VM execution. Like the -M option of
88              faltest, this function sets the falcon engine memory  allocators
89              to  slower  functions that checks for memory to be allocated and
90              deallocated correctly during the execution of a module.  If  the
91              script is executed, before Falcon exits it writes a small report
92              to the standard output.
93
94       -d <directive>=<value>
95              Sets the given  directive  to  the  desired  value.  Compilation
96              directives  and  their  values are the ones that scripts can set
97              through the directive statement.
98
99       -D <constant>=<value>
100              Sets the given constant to the desired value. Constants are made
101              available at compile time, and can be employed in macro and meta
102              compilation.
103
104       -e <enc>
105              Set given encoding as default for VM  I/O.  Unless  the  scripts
106              select  a  different I/O encoding, the streams that are provided
107              to the falcon VM (like the output stream for printf) are encoded
108              using  the given ISO encoding. This overrides the default encod‐
109              ing that is detected by reading  the  environment  settings.  In
110              example, if your system uses iso-8859-1 encoding by default, but
111              you want your script to read and  write  utf-8  files,  use  the
112              option -e utf-8
113
114              The -e option also determines the default encoding of the source
115              files. To override this, use -E
116
117       -E <enc>
118              Set source script encoding. As -e , but this determines only the
119              encoding  used  by  falcon when loading the source scripts. This
120              options overrides -e values, so it can be used to set the script
121              encoding  when they have to read and write from different encod‐
122              ings.
123
124       -f     Force recompilation of modules even when .fam are found.
125
126       -h or -?
127              Prints a brief help on stdout and exits.
128
129       -h or -?
130              Interactive mode. Falcon interpreter reads  language  statements
131              from a prompt and present evaluation results to the user.
132
133       -l <lang_code>
134              Select a different language code for internationalized programs.
135              This option loads an alternate string table for all the  modules
136              loaded.  If  the  table  doesn't exist or if the modules doesn't
137              have a .ftr  file  containing  the  translation,  the  operation
138              silently  files  and the original strings are used instead. Lan‐
139              guage codes should be in the international ISO  format  of  five
140              characters  with a language name, an underscore and the regional
141              code, like in en_US
142
143       -L <path>
144              Changes the default load path. This overrides both the  internal
145              built  in settings and the contents of environment variable FAL‐
146              CON_LOAD_PATH. Each directory in the path should be separated by
147              ";" and use forward slashes, like this:
148
149              falcon -L
150
151
152       -m     Use  temporary files for intermediate steps. By default compila‐
153              tion is completely performed in memory; this option makes falcon
154              to use temporary files instead.
155
156       -M     Do NOT save the compiled modules in '.fam' files.
157
158
159       -o <fn>
160              Redirects  output  to <fn>. This is useful to control the output
161              of falcon when using options as -c, -a, -S etc.  If  <fn>  is  a
162              dash (-) the output is sent to stdout.
163
164       -p <module>
165              Preloads  the  given  module  as  if  it were loaded by the main
166              script.
167
168       -P     Ignore default load paths and uses only the paths set via the -L
169              switch.
170
171       -r     Ignore  source  files and only use available .fam. This does not
172              affects the main script; use the -x  option  if  also  the  main
173              script  is  a pre-compiled .fam module and source script must be
174              ignored.
175
176       -S     Produce an assembly output. Writes an assembly representation of
177              the given script to the standard output aznd the exit. Use -o to
178              change file destination.
179
180       -t     Generates a syntactic tree of the source and writes  it  to  the
181              standard output, then exits. The syntactic tree is a representa‐
182              tion of the script that is known by the compiler and used by the
183              generators  to create the final code. This option is useful when
184              debugging the compiler and to test for the  correct  working  of
185              optimization algorithm.
186
187       -T     Force  input  parsing  as  .ftd (Falcon Template Document). Nor‐
188              mally, only files ending with ".ftd" (case sensitive) are parsed
189              as template document; when this switch is selected, the input is
190              treated as a template document regardless of its name.
191
192       -v     Prints copyright notice and version and exits.
193
194       -w     After execution, requires the user to confirm  program  termina‐
195              tion  by pressing <enter>.  This helps in point & click environ‐
196              ments, where Falcon window is closed as soon as the program ter‐
197              minates.
198
199       -x     Executes a pre-compiled .fam module.
200
201       -y     Creates  a  template file for internationalization.  This option
202              creates a single .ftt file from a single source, .fam module  or
203              binary  module. By default, the name of the template is the same
204              as the module plus ".temp.ftt" added at the end; it is  possible
205              to change the destination template file using the -o option.
206
207

FILES

209       /usr/lib/libfalcon_engine.so
210              Default location of the Falcon Engine loadable module.
211
212       /usr/lib/falcon
213              Default directory containing Falcon binary modules.
214
215

ENVIRONMENT

217       FALCON_LOAD_PATH
218              Default search path for modules loaded by the scripts.
219
220
221       FALCON_SRC_ENCODING
222              Default  encoding  for the source scripts loaded by falcon (when
223              different from the system default).
224
225
226       FALCON_VM_ENCODING
227              Default encoding for the VM I/O  streams  (when  different  from
228              system default).
229
230

AUTHOR

232       Giancarlo Niccolai <gc@falconpl.org>
233
234

SEE ALSO

236       falrun(1) faldisass(1) fallc.fal(1)
237
238

LICENSE

240       This  document  is  released under the "GNU Free Documentation License,
241       version 1.2".  On Debian systems, the complete text of the  Free  Docu‐
242       mentation  License,  version  1.2,  can  be  found  in  /usr/share/com‐
243       mon-licenses/.
244
245
246
247
248Falcon toolset                    April 2007                         falcon(1)
Impressum