1 .TH LPLC "1" "2017-02-09" "lplc 0.1" "User Commands" 2 .SH NAME 3 lplc \- Lichen Python-like compiler 4 .SH SYNOPSIS 5 .B lplc 6 .RI [ options ] 7 .I file 8 .br 9 .B lplc 10 .I --help 11 .br 12 .B lplc 13 .I --version 14 .SH DESCRIPTION 15 .B lplc 16 compiles programs written in the Lichen language, taking the indicated 17 .I file 18 representing the principal source file of a program, compiling the program to an 19 intermediate representation, and then building the result using a C compiler and 20 .B make 21 to produce an executable. Other source files need not be specified: they will be 22 identified by the compiler and loaded as required. 23 .SH OPTIONS 24 The following options may be specified: 25 .PP 26 .TP 27 .BR \-c ", " \-\-compile 28 Only partially compile the program; do not build or link it 29 .TP 30 .BR \-E ", " \-\-no\-env 31 Ignore environment variables affecting the module search path 32 .TP 33 .BR \-g ", " \-\-debug 34 Generate debugging information for the built executable 35 .TP 36 .BR \-G ", " \-\-gc\-sections 37 Remove superfluous sections of the built executable by applying the 38 .B \-\-gc\-sections 39 linker option and associated compiler options 40 .TP 41 .BR \-P ", " \-\-show\-path 42 Show the module search path 43 .TP 44 .BR \-q ", " \-\-quiet 45 Silence messages produced when building an executable 46 .TP 47 .BR \-r ", " \-\-reset 48 Reset (discard) cached information; inspect the whole program again 49 .TP 50 .BR \-R ", " \-\-reset\-all 51 Reset (discard) all program details including translated code 52 .TP 53 .BR \-t ", " \-\-no\-timing 54 Silence timing messages 55 .TP 56 .BR \-tb ", " \-\-traceback 57 Provide a traceback for any internal errors (development only) 58 .TP 59 .BR \-v ", " \-\-verbose 60 Report compiler activities in a verbose fashion (development only) 61 .PP 62 Some options may be followed by values, either immediately after the option 63 (without any space between) or in the arguments that follow them: 64 .PP 65 .TP 66 .B \-o 67 Indicate the output executable name 68 .TP 69 .B \-W 70 Show warnings on the topics indicated 71 .PP 72 Currently, the following warnings are supported: 73 .TP 74 .B all 75 Show all possible warnings 76 .TP 77 .B args 78 Show invocations where a callable may be involved that cannot accept 79 the arguments provided 80 .PP 81 Control over program organisation can be exercised using the following options 82 with each requiring an input filename providing a particular form of 83 information: 84 .TP 85 .B \-\-attr\-codes 86 Attribute codes identifying named object attributes 87 .TP 88 .B \-\-attr\-locations 89 Attribute locations in objects 90 .TP 91 .B \-\-param\-codes 92 Parameter codes identifying named parameters 93 .TP 94 .B \-\-param\-locations 95 Parameter locations in signatures 96 .PP 97 The following informational options can be specified to produce output instead 98 of compiling a program: 99 .PP 100 .TP 101 .BR \-h ", " \-? ", " \-\-help 102 Show a summary of the command syntax and options 103 .TP 104 .BR \-V ", " \-\-version 105 Show version information for this tool 106 .SH INCREMENTAL COMPILATION 107 Invocations of 108 .B lplc 109 without the reset options 110 .BR \-r ", " \-\-reset ", " \-R " or " \-\-reset\-all 111 will cause incremental translation and compilation to be attempted. Where 112 existing translated sources exist and where no changes to the object structures 113 or callable signatures are made, only updated sources will be generated and 114 compiled. Otherwise, where structures or signatures change in a way that is 115 incompatible with already-compiled code, the entire program will be generated 116 and compiled again. 117 .PP 118 The 119 .BR \-r " and " \-\-reset 120 options force inspection and compilation to occur again but will still attempt 121 to preserve structure and signature information. Meanwhile, the 122 .BR \-R " and " \-\-reset\-all 123 options remove all traces of previous program information, requiring that all 124 such information be generated again. 125 .SH PROGRAM CONFIGURATION 126 Use of the 127 .BR \-\-attr\-codes " and " \-\-param\-codes 128 options is intended to allow common catalogues of identifying codes to be 129 maintained. Similarly, use of the 130 .BR \-\-attr\-locations " and " \-\-param\-locations 131 options is intended to allow common representations to be maintained. 132 .PP 133 Beyond incremental compilation, these features would allow already-compiled 134 programs and libraries to exchange information in a compatible way, although 135 this is not yet supported in any significant way. However, the 136 .B \-\-attr\-locations 137 option can be useful in directing the attribute allocation process and 138 potentially making program representations more efficient. 139 .SH EXAMPLES 140 Compile the main program in 141 .BR hello.py , 142 including all source files that the program requires: 143 .IP 144 lplc -o hello hello.py 145 .PP 146 This produces an output executable called 147 .B hello 148 in the current directory, assuming that 149 .B hello.py 150 can be compiled without errors. 151 .SH FILES 152 .B lplc 153 produces an output executable file called 154 .B _main 155 unless the 156 .B \-o 157 option is given with a different name. Working data is stored in a directory 158 whose name is derived from the output executable name. Therefore, the working 159 data directory will be called 160 .B _main.lplc 161 unless otherwise specified. For example, an output executable called 162 .B hello 163 will have a working data directory called 164 .BR hello.lplc . 165 This is intended to allow work to proceed efficiently on multiple programs in 166 the same directory, although it can also create lots of unwanted directories. 167 .SH ENVIRONMENT 168 .TP 169 ARCH 170 Indicates a prefix to be used with tool names when building an executable. This 171 permits things like cross-compilation where tools have been provided with names 172 featuring architecture- and system-specific prefixes. For example, 173 .I mipsel-linux-gnu 174 may be used to indicate the use of tools for the MIPS architecture running 175 GNU/Linux in little-endian mode. 176 .TP 177 LICHENPATH 178 A collection of directories that are searched before those in the collection 179 comprising the default "module search path". This collection, if already defined 180 in the environment, may be excluded by specifying the 181 .BR \-E " (or " \-\-no\-env ) 182 option. 183 .SH AUTHOR 184 Paul Boddie <paul@boddie.org.uk> 185 .SH RESOURCES 186 The project Web site: http://projects.boddie.org.uk/Lichen 187 .SH COPYRIGHT 188 Copyright \(co 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 189 2014, 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk> 190 .PP 191 This program is free software; you may redistribute it under the terms of 192 the GNU General Public License version 3 or (at your option) a later version. 193 This program has absolutely no warranty. 194 .SH SEE ALSO 195 .BR cc (1), 196 .BR make (1).