Skip to content
Permalink
Browse files
Make bison grammar compatible with bison 2.1
https://bugs.webkit.org/show_bug.cgi?id=148731

Patch by Alex Christensen <achristensen@webkit.org> on 2015-09-02
Reviewed by Tim Horton.

.:

* Source/cmake/WebKitCommon.cmake:
Support bison 2.1.

Source/WebCore:

* css/CSSGrammar.y.in:
* xml/XPathGrammar.y:
Move all union fields to one union so bison 2.1 generates equivalent output.

Canonical link: https://commits.webkit.org/166845@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Alex Christensen authored and webkit-commit-queue committed Sep 3, 2015
1 parent 9ecb075 commit 73a1a39dae0b71a47582ac6f092e044fa0465877
Showing 5 changed files with 56 additions and 31 deletions.
@@ -1,3 +1,13 @@
2015-09-02 Alex Christensen <achristensen@webkit.org>

Make bison grammar compatible with bison 2.1
https://bugs.webkit.org/show_bug.cgi?id=148731

Reviewed by Tim Horton.

* Source/cmake/WebKitCommon.cmake:
Support bison 2.1.

2015-08-31 Carlos Alberto Lopez Perez <clopez@igalia.com>

[CMake] Build with Debug Fission on by default on Debug builds.
@@ -1,3 +1,14 @@
2015-09-02 Alex Christensen <achristensen@webkit.org>

Make bison grammar compatible with bison 2.1
https://bugs.webkit.org/show_bug.cgi?id=148731

Reviewed by Tim Horton.

* css/CSSGrammar.y.in:
* xml/XPathGrammar.y:
Move all union fields to one union so bison 2.1 generates equivalent output.

2015-09-02 Dean Jackson <dino@apple.com>

Add some Houdini specs to the features list
@@ -31,6 +31,27 @@
CSSParserString string;
CSSSelector::MarginBoxType marginBox;
CSSParserValue value;
CSSParserSelectorCombinator relation;
StyleRuleBase* rule;
Vector<RefPtr<StyleRuleBase>>* ruleList;
MediaQuerySet* mediaList;
MediaQuery* mediaQuery;
MediaQuery::Restrictor mediaQueryRestrictor;
MediaQueryExp* mediaQueryExp;
Vector<CSSParser::SourceSize>* sourceSizeList;
Vector<std::unique_ptr<MediaQueryExp>>* mediaQueryExpList;
StyleKeyframe* keyframe;
Vector<RefPtr<StyleKeyframe>>* keyframeRuleList;
CSSPropertyID id;
CSSParserSelector* selector;
Vector<std::unique_ptr<CSSParserSelector>>* selectorList;
bool boolean;
CSSSelector::Match match;
int integer;
char character;
CSSParserValueList* valueList;
Vector<CSSParserString>* stringList;
CSSParser::Location location;
}

%{
@@ -225,37 +246,29 @@ static bool selectorListDoesNotMatchAnyPseudoElement(const Vector<std::unique_pt

%token <string> UNICODERANGE

%union { CSSParserSelectorCombinator relation; }
%type <relation> combinator

%union { StyleRuleBase* rule; }
%type <rule> block_rule block_valid_rule font_face import keyframes media page region rule ruleset valid_rule
%destructor { if ($$) $$->deref(); } block_rule block_valid_rule font_face import keyframes media page region rule ruleset valid_rule

%union { Vector<RefPtr<StyleRuleBase>>* ruleList; }
%type <ruleList> block_rule_list block_valid_rule_list
%destructor { delete $$; } block_rule_list block_valid_rule_list

%type <string> ident_or_string maybe_ns_prefix namespace_selector string_or_uri

%type <marginBox> margin_sym

%union { MediaQuerySet* mediaList; }
%type <mediaList> media_list maybe_media_list
%destructor { if ($$) $$->deref(); } media_list maybe_media_list

%union { MediaQuery* mediaQuery; }
%type <mediaQuery> media_query
%destructor { delete $$; } media_query

%union { MediaQuery::Restrictor mediaQueryRestrictor; }
%type <mediaQueryRestrictor> maybe_media_restrictor

%union { MediaQueryExp* mediaQueryExp; }
%type <mediaQueryExp> media_query_exp base_media_query_exp
%destructor { delete $$; } media_query_exp base_media_query_exp

%union { Vector<CSSParser::SourceSize>* sourceSizeList; }
%type <sourceSizeList> source_size_list
%destructor { delete $$; } source_size_list

@@ -265,17 +278,14 @@ static bool selectorListDoesNotMatchAnyPseudoElement(const Vector<std::unique_pt
%type <value> source_size_length
%destructor { destroy($$); } source_size_length

%union { Vector<std::unique_ptr<MediaQueryExp>>* mediaQueryExpList; }
%type <mediaQueryExpList> media_query_exp_list maybe_and_media_query_exp_list
%destructor { delete $$; } media_query_exp_list maybe_and_media_query_exp_list

%type <string> keyframe_name

%union { StyleKeyframe* keyframe; }
%type <keyframe> keyframe_rule
%destructor { if ($$) $$->deref(); } keyframe_rule

%union { Vector<RefPtr<StyleKeyframe>>* keyframeRuleList; }
%type <keyframeRuleList> keyframes_rule
%destructor { delete $$; } keyframes_rule

@@ -286,44 +296,34 @@ static bool selectorListDoesNotMatchAnyPseudoElement(const Vector<std::unique_pt
%type <value> calc_function function min_or_max_function term
%destructor { destroy($$); } calc_function function min_or_max_function term

%union { CSSPropertyID id; }
%type <id> property

%union { CSSParserSelector* selector; }
%type <selector> attrib class page_selector pseudo pseudo_page complex_selector complex_selector_with_trailing_whitespace compound_selector specifier specifier_list
%destructor { delete $$; } attrib class page_selector pseudo pseudo_page complex_selector complex_selector_with_trailing_whitespace compound_selector specifier specifier_list

%union { Vector<std::unique_ptr<CSSParserSelector>>* selectorList; }
%type <selectorList> selector_list nested_selector_list simple_selector_list nth_selector_ending
%destructor { delete $$; } selector_list nested_selector_list simple_selector_list
%destructor { delete $$; } nth_selector_ending

%union { bool boolean; }
%type <boolean> attrib_flags declaration declaration_list decl_list priority

%union { CSSSelector::Match match; }
%type <match> match

%union { int integer; }
%type <integer> unary_operator maybe_unary_operator

%union { char character; }
%type <character> operator calc_func_operator

%union { CSSParserValueList* valueList; }
%type <valueList> calc_func_expr calc_func_expr_list calc_func_paren_expr expr key_list maybe_media_value valid_calc_func_expr valid_expr
%destructor { delete $$; } calc_func_expr calc_func_expr_list calc_func_paren_expr expr key_list maybe_media_value valid_calc_func_expr valid_expr

%type <string> lang_range
%union { Vector<CSSParserString>* stringList; }
%type <stringList> comma_separated_lang_ranges
%destructor { delete $$; } comma_separated_lang_ranges

%type <string> min_or_max

%type <string> element_name

%union { CSSParser::Location location; }
%type <location> error_location

#if ENABLE_CSS_GRID_LAYOUT
@@ -51,46 +51,50 @@ using namespace XPath;
%lex-param { parser }
%parse-param { Parser& parser }

%union { NumericOp::Opcode numericOpcode; }
%union {
NumericOp::Opcode numericOpcode;
EqTestOp::Opcode equalityTestOpcode;
StringImpl* string;
Step::Axis axis;
LocationPath* locationPath;
Step::NodeTest* nodeTest;
Vector<std::unique_ptr<Expression>>* expressionVector;
Step* step;
Expression* expression;
}
%left <numericOpcode> MULOP

%union { EqTestOp::Opcode equalityTestOpcode; }
%left <equalityTestOpcode> EQOP RELOP

%left PLUS MINUS

%left OR AND

%union { StringImpl* string; }
%token <string> FUNCTIONNAME LITERAL NAMETEST NUMBER NODETYPE VARIABLEREFERENCE
%destructor { if ($$) $$->deref(); } FUNCTIONNAME LITERAL NAMETEST NUMBER NODETYPE VARIABLEREFERENCE

%union { Step::Axis axis; }
%token <axis> AXISNAME
%type <axis> AxisSpecifier

%token COMMENT DOTDOT PI NODE SLASHSLASH TEXT XPATH_ERROR

%union { LocationPath* locationPath; }
%type <locationPath> LocationPath AbsoluteLocationPath RelativeLocationPath
%destructor { delete $$; } LocationPath AbsoluteLocationPath RelativeLocationPath

%union { Step::NodeTest* nodeTest; }
%type <nodeTest> NodeTest
%destructor { delete $$; } NodeTest

%union { Vector<std::unique_ptr<Expression>>* expressionVector; }
%type <expressionVector> ArgumentList PredicateList OptionalPredicateList
%destructor { delete $$; } ArgumentList PredicateList OptionalPredicateList

%union { Step* step; }
%type <step> Step AbbreviatedStep DescendantOrSelf
%destructor { delete $$; } Step AbbreviatedStep DescendantOrSelf

%union { Expression* expression; }
%type <expression> AdditiveExpr AndExpr Argument EqualityExpr Expr FilterExpr FunctionCall MultiplicativeExpr OrExpr PathExpr Predicate PrimaryExpr RelationalExpr UnaryExpr UnionExpr
%destructor { delete $$; } AdditiveExpr AndExpr Argument EqualityExpr Expr FilterExpr FunctionCall MultiplicativeExpr OrExpr PathExpr Predicate PrimaryExpr RelationalExpr UnaryExpr UnionExpr



%{

static int xpathyylex(YYSTYPE* yylval, Parser& parser) { return parser.lex(*yylval); }
@@ -1,7 +1,7 @@
# -----------------------------------------------------------------------------
# Find common packages (used by all ports)
# -----------------------------------------------------------------------------
find_package(BISON 2.3 REQUIRED)
find_package(BISON 2.1 REQUIRED)
if (!APPLE)
find_package(FLEX 2.5.34 REQUIRED)
endif ()

0 comments on commit 73a1a39

Please sign in to comment.