summaryrefslogtreecommitdiff
path: root/decoder
diff options
context:
space:
mode:
authorgraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-15 04:31:37 +0000
committergraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-15 04:31:37 +0000
commitf930e4efe2c594ac87ea650841fcb751159e909c (patch)
tree7e98b3e5979e9f77330bf1600841af9424e93fec /decoder
parent541915be79d90329f40381ef75c98c794ea0298c (diff)
yyunput warning
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@553 ec762483-ff6d-05da-a07a-a48fb63a330f
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;