X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/2c1bf9bd68c361a55ef0130f269a674a4e87996e..219139f52178b3e020be1952c59b1ba76009c386:/data/java.m4 diff --git a/data/java.m4 b/data/java.m4 index 4b33728a..1b8666e4 100644 --- a/data/java.m4 +++ b/data/java.m4 @@ -2,7 +2,7 @@ # Java language support for Bison -# Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2007-2012 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -147,7 +147,7 @@ m4_define([b4_integral_parser_table_define], # Output the definition of this token as an enum. m4_define([b4_token_enum], [ /** Token number, to be returned by the scanner. */ - static final int $1 = $2; + static final int b4_percent_define_get([api.tokens.prefix])$1 = $2; ]) @@ -169,6 +169,13 @@ m4_define([b4_case], [ case $1: break; ]) +# b4_predicate_case(LABEL, CONDITIONS) +# ------------------------------------ +m4_define([b4_predicate_case], [ case $1: + if (! ($2)) YYERROR; + break; + ]) + ## ---------------- ## ## Default values. ## @@ -247,7 +254,7 @@ m4_define([b4_lex_param], b4_lex_param) m4_define([b4_parse_param], b4_parse_param) # b4_lex_param_decl -# ------------------- +# ----------------- # Extra formal arguments of the constructor. m4_define([b4_lex_param_decl], [m4_ifset([b4_lex_param], @@ -275,7 +282,7 @@ m4_define([b4_parse_param_decl], # b4_lex_param_call -# ------------------- +# ----------------- # Delegating the lexer parameters to the lexer constructor. m4_define([b4_lex_param_call], [m4_ifset([b4_lex_param],