From 8078d0be612c4ff89e3cb7dd31af077c0be6d0d9 Mon Sep 17 00:00:00 2001 From: "graehl@gmail.com" Date: Sun, 15 Aug 2010 04:31:37 +0000 Subject: yyunput warning git-svn-id: https://ws10smt.googlecode.com/svn/trunk@553 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/rule_lexer.l | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'decoder') 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 %% -[ \t] { - ctf_level++; +[ \t] { + ctf_level++; }; \[{NT}\] { @@ -191,7 +192,7 @@ NT [^\t \[\],]+ memset(scfglex_nt_sanity, 0, scfglex_src_arity * sizeof(int)); BEGIN(TRG); } -[^ \t]+ { +[^ \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(); } -{REAL} { +{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; -- cgit v1.2.3