Add basic error handling
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,6 @@
|
|||||||
.antlr/
|
.antlr/
|
||||||
build/
|
build/
|
||||||
|
lib/
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
*.d
|
*.d
|
||||||
|
|
||||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -6,5 +6,8 @@
|
|||||||
"listeners": true,
|
"listeners": true,
|
||||||
"visitors": true,
|
"visitors": true,
|
||||||
"outputDir": "../lib/generated"
|
"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
|
#pragma once
|
||||||
#define FIVE 5
|
|
||||||
#endif
|
#define FOO 1
|
||||||
|
@@ -41,11 +41,10 @@ public:
|
|||||||
|
|
||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
// std::cout<<"Hello World "<<FIVE<<std::endl;
|
|
||||||
std::ifstream stream;
|
std::ifstream stream;
|
||||||
try{
|
|
||||||
stream.open(argv[1]);
|
stream.open(argv[1]);
|
||||||
}catch(std::exception e){
|
if(stream.fail()){
|
||||||
std::cout<<"Could not open"<<std::endl;
|
std::cout<<"Could not open"<<std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user