Commit 1196ecef authored by Sergio Costas's avatar Sergio Costas

Allows to generate the *crust.h* file just calling crust, instead of having to...

Allows to generate the *crust.h* file just calling crust, instead of having to copy it from elsewhere
parent 39b90f25
# History of versions #
* version 0.3 (2019-08-25)
* Allows to generate the *crust.h* file just calling crust, instead of having to copy it from elsewhere
* version 0.2 (2018-08-23)
* First public version
......@@ -35,20 +35,24 @@ library with the parser, and install the static analyzer.
## USAGE
For detailed documentation, check the *doc* folder.
crust [-I include_path] [-I...] [-D define] [-D...] [--include filename] [--include...] [--nowarnings] [--nocpp] [--quiet] [-e exclude_filename] [--debug1=nline] [--debug2=nline] file.c [file.c] ...
* -I allows to specify paths where the C preprocessor will search for header files. Can be repeated as many times as paths have to be added
* -D allows to specify #defines from command line that the C preprocessor must consider defined. Can be repeated as many times as defines are needed
* --include allows to include a file in the final preprocessed code. Can be repeated as many times as defines are needed
* --nowarnings will hide the WARNING messages, showing only ERROR and CRITICAL messages
* --nocpp will pass the source code directly to the parser, instead of pass it before through the C preprocessor
* --quiet will not show extra information
* -e allows to specify file names to exclude. This is useful when a filename contains wildcards
* --preprocessed stores the preprocessed code (this is, after being passed through the C PreProcessor) with the specified filename
* --debug1 & --debug2 shows the parsed tree between source code lines specified in both statements
* file.c the path to the file or files to analyze. It can contain wildcards, and it is possible to also specify several files
* -I allows to specify paths where the C preprocessor will search for header files. Can be repeated as many times as paths have to be added
* -D allows to specify #defines from command line that the C preprocessor must consider defined. Can be repeated as many times as defines are needed
* --include allows to include a file in the final preprocessed code. Can be repeated as many times as defines are needed
* --nowarnings will hide the WARNING messages, showing only ERROR and CRITICAL messages
* --nocpp will pass the source code directly to the parser, instead of pass it before through the C preprocessor
* --quiet will not show extra information
* -e allows to specify file names to exclude. This is useful when a filename contains wildcards
* --preprocessed stores the preprocessed code (this is, after being passed through the C PreProcessor) with the specified filename
* --debug1 & --debug2 shows the parsed tree between source code lines specified in both statements
* file.c the path to the file or files to analyze. It can contain wildcards, and it is possible to also specify several files
For detailed documentation, check the *doc* folder.
crust --headers
* will generate the file *crust.h*, needed to compile any source or header file that contains crust qualifiers, in the current folder.
## CONTACTING THE AUTHOR
......
No preview for this file type
......@@ -33,7 +33,7 @@ def get_data_files():
data_files = []
data_files.append(('crust',[os.path.join('src', 'lexyacclib', 'crust_code.h'), os.path.join('src', 'lexyacclib', 'crust.so')]))
data_files.append(('crust',[os.path.join('src', 'lexyacclib', 'crust_code.h'), os.path.join('src', 'lexyacclib', 'crust.so'), 'crust.h']))
try:
for lang_name in [f for f in os.listdir('locale')]:
......
......@@ -97,6 +97,12 @@ def get_parameters():
print(" --debug1 & --debug2 shows the parsed tree between source code lines specified in both statements")
print(" file.c the path to the file or files to analyze. It can contain wildcards, and it is possible to also specify several files")
print()
print()
print(" crust --headers")
print()
print(" Creates the file crust.h in the current folder, needed to compile files that includes crust specific tags")
print()
print()
sys.exit(0)
if parameter == "--preprocessed":
store_next = "preprocessed"
......@@ -115,6 +121,13 @@ def get_parameters():
else:
exclude_files.append(parameter[2:])
continue
if parameter == "--headers":
header = pkg_resources.resource_filename('crust','/crust.h')
with open(header, "r") as header2:
with open("crust.h", "w") as header3:
for linea in header2:
header3.write(linea)
sys.exit(0)
if parameter.startswith("--debug1="):
try:
parameters["debug1"] = int(parameter[9:])
......
......@@ -19,7 +19,7 @@
class crust_definitions(object):
version = "0.2"
version = "0.3"
# when a variable hasn't been assigned yet
VALUE_UNINITIALIZED = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment