Build system - COBOL
Build system - COBOL
It appears that it is possible to compile and run programs developed in CudaText. I would like to be able to compile/run COBOL programs using either a MIcro Focus compiler or the GNUCobol compiler. Is there a tutorial on how to do this?
Thanks
Thanks
-
- Posts: 2265
- Joined: 25.08.2021 18:15
Yes, we have 2 plugins to run tools.
8 External Tools
8.1 Introduction to External Tools
8.2 Tool to compile by GCC
8.3 Tool to run C program
etc
9 Runner
9.1 Runner limitation for input
9.2 Runner tool for C
9.3 Runner tool for C++
etc
https://wiki.freepascal.org/CudaText_plugins
8 External Tools
8.1 Introduction to External Tools
8.2 Tool to compile by GCC
8.3 Tool to run C program
etc
9 Runner
9.1 Runner limitation for input
9.2 Runner tool for C
9.3 Runner tool for C++
etc
https://wiki.freepascal.org/CudaText_plugins
Plug in doessn't appear in 'Install'
I have a COBOL plugin - OpenCOBOL.sublime-build - which I have put in the CudaText -> data -> buildsystems folder along with the other *.sublime-builds.
However when I attempt to install it via Plugins -> Addons Manager -> Install the COBOL item does not appear in the Install drop down dialogue and, therefore, I cannot install it.
Please advise
However when I attempt to install it via Plugins -> Addons Manager -> Install the COBOL item does not appear in the Install drop down dialogue and, therefore, I cannot install it.
Please advise
-
- Posts: 2265
- Joined: 25.08.2021 18:15
OpenCOBOL.sublime-build is NOT a plugin (for Cudatext).
you don't need to install it.
it is the data file for the RUNNER plugin.
so you need the Runner plugin installed.
also you need the COBOL lexer from Addons Manager.
what does Runner show when you try to call the tool?
Docs:
9 Runner
9.1 Runner limitation for input
9.2 Runner tool for C
9.3 Runner tool for C++
9.4 Runner tool for PHP
9.5 Runner tool for Python
9.6 Runner tool for Free Pascal
https://wiki.freepascal.org/CudaText_plugins
you don't need to install it.
it is the data file for the RUNNER plugin.
so you need the Runner plugin installed.
also you need the COBOL lexer from Addons Manager.
what does Runner show when you try to call the tool?
Docs:
9 Runner
9.1 Runner limitation for input
9.2 Runner tool for C
9.3 Runner tool for C++
9.4 Runner tool for PHP
9.5 Runner tool for Python
9.6 Runner tool for Free Pascal
https://wiki.freepascal.org/CudaText_plugins
-
- Posts: 2265
- Joined: 25.08.2021 18:15
Alexey
I apologise for my confusion. I am struggling with the syntax of the build systems. I have modified OpenCOBOL.sublime-build as follows:
I am not sure how - other than to hard code the path and file name - to specify the file (and its location) to be compiled.
When I run Runner and state 'Build' CudaText gives a message: "No command "Build" in build system "OpenCOBOL"". The command cobc -x is the command to compile with OpenCOBOL (now called GnuCOBOL). Also I don't need the 'osx' and 'linux' sections for my use.
Thanks
I apologise for my confusion. I am struggling with the syntax of the build systems. I have modified OpenCOBOL.sublime-build as follows:
Code: Select all
{
"selector": "source.cobol",
"cmd": [
"cobc -x -std=mf c:\workarea\gnucobol\beeb\bbcb.cbl -o beeb.exe -W"
],
"working_dir": "$file_path",
"shell": true,
"file_regex": "^([^:]+):([0-9]+):",
"osx": {
"env": {
"PATH": "/usr/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin:$PATH"
}
},
"linux": {
"env": {
"PATH": "/usr/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin:$PATH"
}
}
}
When I run Runner and state 'Build' CudaText gives a message: "No command "Build" in build system "OpenCOBOL"". The command cobc -x is the command to compile with OpenCOBOL (now called GnuCOBOL). Also I don't need the 'osx' and 'linux' sections for my use.
Thanks
-
- Posts: 2265
- Joined: 25.08.2021 18:15
then you can ignore keys "osx" and "linux". these keys will be auto ignored.Also I don't need the 'osx' and 'linux' sections for my use.
this is maybe the culprit. Runner-plugin cannot handle this line. it is SublimeText only. for Runner, see how FreePascal build-system specifies the file:"selector": "source.cobol",
Code: Select all
{
"file_patterns": ["*.pp", "*.pas", "*.lpr"],
"file_regex": "(.+?)\\((\\d+),(\\d+)\\)\\s(.+)$",
"working_dir": "$file_path",
"name": "Compile",
"cmd": ["/home/user/fpcupdeluxe/fpcupdeluxe/fpc/bin/x86_64-linux/fpc.sh", "$file_name"],
"variants": [
{
"name": "Run",
"cmd": ["./$file_base_name"]
}
]
}
so for Cobol lexer, try to add this:"file_patterns": ["*.pp", "*.pas", "*.lpr"],
"file_patterns": ["*.cob", "*.cbl"],
-
- Posts: 2265
- Joined: 25.08.2021 18:15