summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'decoder')
-rw-r--r--decoder/rule_lexer.l11
1 files changed, 6 insertions, 5 deletions
diff --git a/decoder/rule_lexer.l b/decoder/rule_lexer.l
index 63eb7562..2de94587 100644
--- a/decoder/rule_lexer.l
+++ b/decoder/rule_lexer.l
@@ -1,3 +1,4 @@
+%option nounput
%{
#include "rule_lexer.h"
@@ -81,7 +82,7 @@ void scfglex_reset() {
void check_and_update_ctf_stack(const TRulePtr& rp) {
if (ctf_level > ctf_rule_stack.size()){
- std::cerr << "Found rule at projection level " << ctf_level << " but previous rule was at level "
+ std::cerr << "Found rule at projection level " << ctf_level << " but previous rule was at level "
<< ctf_rule_stack.size()-1 << " (cannot exceed previous level by more than one; line " << lex_line << ")" << std::endl;
abort();
}
@@ -115,8 +116,8 @@ NT [^\t \[\],]+
%x LHS_END SRC TRG FEATS FEATVAL ALIGNS
%%
-<INITIAL>[ \t] {
- ctf_level++;
+<INITIAL>[ \t] {
+ ctf_level++;
};
<INITIAL>\[{NT}\] {
@@ -191,7 +192,7 @@ NT [^\t \[\],]+
memset(scfglex_nt_sanity, 0, scfglex_src_arity * sizeof(int));
BEGIN(TRG);
}
-<SRC>[^ \t]+ {
+<SRC>[^ \t]+ {
scfglex_tmp_token.assign(yytext, yyleng);
scfglex_src_rhs[scfglex_src_rhs_size] = TD::Convert(scfglex_tmp_token);
++scfglex_src_rhs_size;
@@ -250,7 +251,7 @@ NT [^\t \[\],]+
std::cerr << "Line " << lex_line << ": unexpected input in feature value: " << yytext << std::endl;
abort();
}
-<FEATS>{REAL} {
+<FEATS>{REAL} {
scfglex_feat_ids[scfglex_num_feats] = scfglex_phrase_fnames[scfglex_num_feats];
scfglex_feat_vals[scfglex_num_feats] = strtod(yytext, NULL);
++scfglex_num_feats;