Add basic error handling
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,6 @@
|
||||
.antlr/
|
||||
build/
|
||||
|
||||
lib/
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -6,5 +6,8 @@
|
||||
"listeners": true,
|
||||
"visitors": true,
|
||||
"outputDir": "../lib/generated"
|
||||
},
|
||||
"files.associations": {
|
||||
"ostream": "cpp"
|
||||
}
|
||||
}
|
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# bfc
|
||||
|
||||
An extension of a language that shall not be named
|
||||
|
||||
## Setup oddities
|
||||
|
||||
1. Copy antlr4's cpp libs to `./libs/antlr4`.
|
||||
2. Copy `antlr-4.8-complete.jar` to `./thirdparty/antlr`.
|
||||
3. Generate parsers to `./libs/generated` or use VSCode with the ANTLR extension.
|
@@ -1,3 +1,3 @@
|
||||
#ifndef __MAIN_HPP
|
||||
#define FIVE 5
|
||||
#endif
|
||||
#pragma once
|
||||
|
||||
#define FOO 1
|
||||
|
@@ -41,11 +41,10 @@ public:
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
// std::cout<<"Hello World "<<FIVE<<std::endl;
|
||||
std::ifstream stream;
|
||||
try{
|
||||
|
||||
stream.open(argv[1]);
|
||||
}catch(std::exception e){
|
||||
if(stream.fail()){
|
||||
std::cout<<"Could not open"<<std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user