[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/5] d: prefer delegation to duplication
From: |
Akim Demaille |
Subject: |
[PATCH 3/5] d: prefer delegation to duplication |
Date: |
Thu, 20 Jun 2019 07:08:29 +0200 |
* data/skeletons/lalr1.d: Delegate the construction of the scanner.
---
data/skeletons/lalr1.d | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/data/skeletons/lalr1.d b/data/skeletons/lalr1.d
index 7c9d6341..b30bce60 100644
--- a/data/skeletons/lalr1.d
+++ b/data/skeletons/lalr1.d
@@ -260,17 +260,15 @@ b4_user_union_members
]b4_lexer_if([[
/**
- * Instantiates the Bison-generated parser.
+ * Instantiate the Bison-generated parser.
*/
public this] (b4_parse_param_decl([b4_lex_param_decl])[) {
- this.yylexer = new YYLexer(]b4_lex_param_call[);
- this.yyDebugStream = stderr;
-]b4_parse_param_cons[
+ this (new YYLexer(]b4_lex_param_call[));
}
]])[
/**
- * Instantiates the Bison-generated parser.
+ * Instantiate the Bison-generated parser.
* @@param yylexer The scanner that will supply tokens to the parser.
*/
]b4_lexer_if([[protected]], [[public]]) [this (]b4_parse_param_decl([[Lexer
yylexer]])[) {
--
2.21.0