Module: LogStashCompilerLSCLGrammar::LogStash::Compiler::LSCL::AST::Helpers
- Included in:
- LogStash::Config::AST::Node, BooleanOperator, ComparisonExpression, ComparisonOperator, Condition, Config, InExpression, NegativeExpression, Node, NotInExpression, RegExpOperator
- Defined in:
- lib/logstash/compiler/lscl/helpers.rb
Overview
Helpers for parsing LSCL files
Constant Summary collapse
- BOOLEAN_DSL_METHOD_SIGNATURE =
[org.logstash.common.SourceWithMetadata, org.logstash.config.ir.expression.Expression, org.logstash.config.ir.expression.Expression]
- AND_METHOD =
jdsl.java_method(:eAnd, BOOLEAN_DSL_METHOD_SIGNATURE)
- NAND_METHOD =
jdsl.java_method(:eNand, BOOLEAN_DSL_METHOD_SIGNATURE)
- OR_METHOD =
jdsl.java_method(:eOr, BOOLEAN_DSL_METHOD_SIGNATURE)
- XOR_METHOD =
jdsl.java_method(:eXor, BOOLEAN_DSL_METHOD_SIGNATURE)
Class Method Summary collapse
Instance Method Summary collapse
- #base_id ⇒ Object
- #base_protocol ⇒ Object
- #base_source_with_metadata ⇒ Object
- #base_source_with_metadata=(value) ⇒ Object
- #compose(*statements) ⇒ Object
- #compose_for(section_sym) ⇒ Object
- #jdsl ⇒ Object
- #line_and_column ⇒ Object
- #source_meta ⇒ Object
Class Method Details
.jdsl ⇒ Object
48 49 50 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 48 def self.jdsl org.logstash.config.ir.DSL end |
Instance Method Details
#base_id ⇒ Object
23 24 25 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 23 def base_id self. ? self..id : 'config_ast' end |
#base_protocol ⇒ Object
19 20 21 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 19 def base_protocol self. ? self..protocol : 'config_ast' end |
#base_source_with_metadata ⇒ Object
15 16 17 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 15 def (:base_source_with_metadata) end |
#base_source_with_metadata=(value) ⇒ Object
11 12 13 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 11 def (value) (:base_source_with_metadata, value) end |
#compose(*statements) ⇒ Object
27 28 29 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 27 def compose(*statements) compose_for(section_type.to_sym).call(, *statements) end |
#compose_for(section_sym) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 31 def compose_for(section_sym) if section_sym == :filter jdsl.method(:iComposeSequence) else jdsl.method(:iComposeParallel) end end |
#jdsl ⇒ Object
44 45 46 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 44 def jdsl org.logstash.config.ir.DSL end |
#line_and_column ⇒ Object
39 40 41 42 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 39 def line_and_column start = self.interval.first [self.input.line_of(start), self.input.column_of(start)] end |
#source_meta ⇒ Object
6 7 8 9 |
# File 'lib/logstash/compiler/lscl/helpers.rb', line 6 def line, column = line_and_column org.logstash.common.SourceWithMetadata.new(base_protocol, base_id, line, column, self.text_value) end |