diff options
author | Joel E. Denny <jdenny@clemson.edu> | 2009-12-22 17:22:24 -0500 |
---|---|---|
committer | Joel E. Denny <jdenny@clemson.edu> | 2009-12-29 16:01:47 -0500 |
commit | 70afaf26037e919f6abf3904e43845d116899df3 (patch) | |
tree | b2d7f22b4382081693b590b3b12eea72d452da99 /data/lalr1.java | |
parent | 8200219a2a98c54a72cd744abbb656e18bd33ccf (diff) | |
download | bison-70afaf26037e919f6abf3904e43845d116899df3.tar.gz |
Port small part of master's 11707b2b so future ports are easier.
* data/lalr1.java (YYParser::yysyntax_error): Untabify.
Diffstat (limited to 'data/lalr1.java')
-rw-r--r-- | data/lalr1.java | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/data/lalr1.java b/data/lalr1.java index 25bb1bdb..8fe59539 100644 --- a/data/lalr1.java +++ b/data/lalr1.java @@ -686,38 +686,38 @@ m4_popdef([b4_at_dollar])])dnl int yyn = yypact_[yystate]; if (yypact_ninf_ < yyn && yyn <= yylast_) { - StringBuffer res; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for this - state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - int count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ - && !yy_table_value_is_error_ (yytable_[x + yyn])) - ++count; - - // FIXME: This method of building the message is not compatible - // with internationalization. - res = new StringBuffer ("syntax error, unexpected "); - res.append (yytnamerr_ (yytname_[tok])); - if (count < 5) - { - count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ - && !yy_table_value_is_error_ (yytable_[x + yyn])) - { - res.append (count++ == 0 ? ", expecting " : " or "); - res.append (yytnamerr_ (yytname_[x])); - } - } - return res.toString (); + StringBuffer res; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for this + state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + int count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_ + && !yy_table_value_is_error_ (yytable_[x + yyn])) + ++count; + + // FIXME: This method of building the message is not compatible + // with internationalization. + res = new StringBuffer ("syntax error, unexpected "); + res.append (yytnamerr_ (yytname_[tok])); + if (count < 5) + { + count = 0; + for (int x = yyxbegin; x < yyxend; ++x) + if (yycheck_[x + yyn] == x && x != yyterror_ + && !yy_table_value_is_error_ (yytable_[x + yyn])) + { + res.append (count++ == 0 ? ", expecting " : " or "); + res.append (yytnamerr_ (yytname_[x])); + } + } + return res.toString (); } } |