Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
fa0d5168
Commit
fa0d5168
authored
14 years ago
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
Changed nor operator name to not. Added tagset to position rules.
parent
4bb3555a
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libwccl/ops/functions/bool/predicates/nor.h
+1
-1
1 addition, 1 deletion
libwccl/ops/functions/bool/predicates/nor.h
libwccl/parser/grammar.g
+42
-8
42 additions, 8 deletions
libwccl/parser/grammar.g
with
43 additions
and
9 deletions
libwccl/ops/functions/bool/predicates/nor.h
+
1
−
1
View file @
fa0d5168
...
...
@@ -21,7 +21,7 @@ public:
* @returns Name of the function: "not"
*/
std
::
string
raw_name
()
const
{
return
"no
t
"
;
return
"no
r
"
;
}
protected
:
...
...
This diff is collapsed.
Click to expand it.
libwccl/parser/grammar.g
+
42
−
8
View file @
fa0d5168
...
...
@@ -342,14 +342,14 @@ position_variable
// realtive position
relpos
[Wccl::Variables& vars]
[
const Corpus2::Tagset& tagset,
Wccl::Variables& vars]
returns [boost::shared_ptr<Wccl::Function<Wccl::Position> > ret]
{
boost::shared_ptr<Wccl::Function<Wccl::Position> > pos;
}
: "relpos"
LPAREN
pos = op_position [vars] ("+" | "-") ofst: UNSIGNED_INT
pos = op_position [
tagset,
vars] ("+" | "-") ofst: UNSIGNED_INT
RPAREN {
ret.reset(new Wccl::RelativePosition(
pos,
...
...
@@ -479,7 +479,7 @@ setvar_body_pos
}
: ret_acc = position_variable_acc [vars]
COMMA
ret_op = op_position [vars] {
ret_op = op_position [
tagset,
vars] {
op.reset(new Wccl::VarSetter<Wccl::Position>(*ret_acc.get(), ret_op));
}
;
...
...
@@ -584,17 +584,18 @@ condit_sym
position_operators
[const Corpus2::Tagset& tagset, Wccl::Variables& vars]
returns [boost::shared_ptr<Wccl::Function<Wccl::Position> > ret]
: ret = op_position [vars]
: ret = op_position [
tagset,
vars]
;
// Implementations of symbol set operators:
// ----------------------------------------------------------------------------
op_position
[Wccl::Variables& vars]
[
const Corpus2::Tagset& tagset,
Wccl::Variables& vars]
returns [boost::shared_ptr<Wccl::Function<Wccl::Position> > op]
: op = position_variable [vars]
| op = position_value
| op = relpos [vars]
| op = relpos [tagset, vars]
// | op = condit_position [tagset, vars]
;
// ----------------------------------------------------------------------------
...
...
@@ -621,7 +622,7 @@ op_orth
{
boost::shared_ptr<Wccl::Function<Wccl::Position> > pos;
}
: "orth" LBRACKET pos = op_position [vars] RBRACKET {
: "orth" LBRACKET pos = op_position [
tagset,
vars] RBRACKET {
ret.reset(new Wccl::GetOrth(pos));
}
;
...
...
@@ -783,7 +784,7 @@ lpred_nor
std::vector<boost::shared_ptr<Wccl::Function<Wccl::Bool> > >
> ret_v;
}
: "no
r
" LPAREN ret_v = logical_predicates_comma_sep [tagset, vars] RPAREN {
: "no
t
" LPAREN ret_v = logical_predicates_comma_sep [tagset, vars] RPAREN {
op.reset(new Wccl::Nor(ret_v));
}
;
...
...
@@ -953,6 +954,39 @@ condit_bool
}
;
// ----------------------------------------------------------------------------
// if (Bool, Position, Position)
// ? Position ? Bool : 0
/* Not implemented yet
*/
/*
condit_position
[const Corpus2::Tagset& tagset, Wccl::Variables& vars]
returns [boost::shared_ptr<Wccl::Function<Wccl::Position> > op]
{
boost::shared_ptr<Wccl::Function<Wccl::Bool> > test;
boost::shared_ptr<Wccl::Function<Wccl::Bool> > p_true, p_false;
}
: "if" LPAREN test = logical_predicates [tagset, vars] COMMA
p_true = position_operators [tagset, vars]
(COMMA p_false = position_operators [tagset, vars])?
RPAREN {
if (p_false) {
op.reset(new Wccl::Conditional<Wccl::Position>(test, p_true, p_false));
}
else {
op.reset(new Wccl::Conditional<Wccl::Position>(test, p_true));
}
}
| Q_MARK
p_true = position_operators [tagset, vars]
Q_MARK
test = logical_predicates [tagset, vars] {
op.reset(new Wccl::Conditional<Wccl::Position>(test, p_true));
}
;
*/
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ANTLR LEXER
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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