Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cdo
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
cdo
Commits
e311be61
Commit
e311be61
authored
2 years ago
by
Oliver Heidmann
Browse files
Options
Downloads
Patches
Plain Diff
added strings for error messages, removed exception declaration from parser header
parent
9d4f10a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!26
parser cleanup and fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/parser.h
+30
-20
30 additions, 20 deletions
src/parser.h
with
30 additions
and
20 deletions
src/parser.h
+
30
−
20
View file @
e311be61
...
...
@@ -4,43 +4,53 @@
#include
<vector>
#include
<stack>
#include
"node.h"
#include
"cdo_syntax_error.h"
namespace
Parser
{
std
::
vector
<
std
::
shared_ptr
<
Node
>>
run
(
std
::
vector
<
std
::
string
>
&
p_argv
);
//'Regular' parser messages
static
std
::
string
errmsg_multiple_variable
=
"Using two operators with variable input without using sub groups [] is not allowed"
;
static
std
::
string
errmsg_missing_outputs
=
"Missing outputs"
;
static
std
::
string
errmsg_missing_inputs
=
"Missing inputs"
;
static
std
::
string
errmsg_unprocessed_inputs
=
"Unprocessed Inputs"
;
static
std
::
string
errmsg_keyword_output
=
"Keywords cannot be used as file names"
;
//Subgroup errors
static
std
::
string
errmsg_mixed_input
=
"Mixing of normal inputs and subgroups is not allowed"
;
static
std
::
string
errmsg_missing_sub_group
=
"Closing bracket without open subgroup"
;
static
std
::
string
errmsg_empty_subgroup
=
"Empty Subgroup"
;
static
std
::
string
errmsg_bracket_not_closed
=
"Bracket not closed"
;
static
std
::
string
errmsg_malformed_subgroup
=
"Malformed Subgroup"
;
//Apply error messages
static
std
::
string
errmsg_only_1_to_1_operators
=
"Only operators with a single in and output allowed"
;
static
std
::
string
errmsg_apply_missing_argument
=
"Missing arguments"
;
static
std
::
string
errmsg_apply_multiple_roots
=
"Apply can only process chains with a single in and out put"
;
static
std
::
string
errmsg_apply_requires_bracket
=
"Apply requires brackets"
;
static
std
::
string
errmsg_apply_no_inputs
=
"Apply content has no available free inputs"
;
static
std
::
string
errmsg_apply_in_first_pos
=
"Apply can not be in first position"
;
std
::
string
err_msg_oper_not_found
(
std
::
string
name
);
std
::
vector
<
std
::
shared_ptr
<
Node
>>
run
(
std
::
vector
<
std
::
string
>
&
p_argv
);
std
::
vector
<
std
::
shared_ptr
<
Node
>>
parse
(
std
::
vector
<
std
::
string
>
p_argv
,
const
char
*
(
*
context
)(
void
)
);
std
::
vector
<
std
::
shared_ptr
<
Node
>>
_parse
(
std
::
vector
<
std
::
string
>
p_argv
,
const
char
*
(
*
context
)(
void
)
);
namespace
Util
{
std
::
string
result_to_string
(
std
::
vector
<
std
::
shared_ptr
<
Node
>>
p_roots
,
std
::
string
p_text
=
"returning: "
);
}
std
::
string
build_err_msg
(
std
::
vector
<
std
::
string
>
&
p_argv
,
const
std
::
vector
<
std
::
string
>::
const_iterator
&
iter
,
const
std
::
string
&
prompt
,
int
cdo_abort_prompt_spacing
=
10
);
}
// namespace Util
struct
MissingOutFileException
:
public
std
::
invalid_argument
{
explicit
MissingOutFileException
(
const
std
::
string
&
p_msg
)
:
std
::
invalid_argument
(
p_msg
)
{}
};
struct
CdoSyntaxError
:
public
std
::
invalid_argument
{
std
::
vector
<
std
::
string
>::
const_iterator
iter
;
CdoSyntaxError
(
std
::
vector
<
std
::
string
>::
const_iterator
p_iter
,
const
std
::
string
&
p_msg
)
:
std
::
invalid_argument
(
p_msg
),
iter
(
p_iter
){};
};
struct
CdoSubGroupSyntaxError
:
public
CdoSyntaxError
{
CdoSubGroupSyntaxError
(
std
::
vector
<
std
::
string
>::
const_iterator
p_iter
,
const
std
::
string
&
p_msg
)
:
CdoSyntaxError
(
p_iter
,
p_msg
){}
};
struct
CdoApplySyntaxError
:
public
CdoSyntaxError
{
CdoApplySyntaxError
(
std
::
vector
<
std
::
string
>::
const_iterator
p_iter
,
const
std
::
string
&
p_msg
)
:
CdoSyntaxError
(
p_iter
,
p_msg
){}
};
}
// namespace Parser
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment