| Class | Generator |
| In: |
EFL.rb
|
| Parent: | Object |
Adds self and generator. Returns a new Generator which substitutions and productions are the union of the substitutions and the productions of self and generator. Collisions between the substitutions of self and generator will be detected automatically calling the method add? (internally, + calls add?)
Superpose generator to self. << actualizes the substitutions and productions of self with the substitutions and productions of generator. The substitutions and productions of generator with a common name in self are overwritten in self. The others are added to self. Collisions between the substitutions of self and generator will be detected automatically calling the method sup (internally, << calls sup?)
Specifies a kind of substitution that inserts the text string after the first occurrence of the pattern expressed by the reg_exp regular expression. Optionally, this substitution can be named using the name string. To express complex ‘after inserts’, the regular expressions can be combined using the zoom operator (Regexp#>).
Specifies a kind of substitution that inserts the text string before the first occurrence of the pattern expressed by the reg_exp regular expression. Optionally, this substitution can be named using the name string. To express complex ‘before inserts’, the regular expressions can be combined using the zoom operator (Regexp#>).
Specifies a kind of substitution that deletes the first occurrence of the pattern expressed by the reg_exp regular expression. Optionally, this substitution can be named using the name string. To express complex deletes, the regular expressions can be combined using the zoom operator (Regexp#>).
Returns an array of the strings resulted on matching the reg_exp regular expression on the input file file
Returns an array of the strings grouped by the parenthesis number when the reg_exp regular expression is matched on the input file.
For example. if the content of myfile.txt is:
This is my code
The result of execute:
g = generator
puts "$1 = " + g.extract_dollar(‘myfile.txt’, /(This).*?(code).*?/, 1).to_s
puts "$2 = " + g.extract_dollar(‘myfile.txt’, /(This).*?(code).*?/, 2).to_s
would be
$1 = This
$2 = code
Specifies a kind of substitution that inserts the text string after all the occurrences of the pattern expressed by the reg_exp regular expression. Optionally, this substitution can be named using the name string. To express complex ‘global after inserts’, the regular expressions can be combined using the zoom operator (Regexp#>).def gbefore(reg_exp, text, name = nil)
Specifies a kind of substitution that inserts the text string before all the occurrences of the pattern expressed by the reg_exp regular expression. Optionally, this substitution can be named using the name string. To express complex ‘global before inserts’, the regular expressions can be combined using the zoom operator (Regexp#>).def gbefore(reg_exp, text, name = nil)
Specifies a kind of substitution that deletes all the occurrence of the pattern expressed by the reg_exp regular expression. Optionally, this substitution can be named using the name string. To express complex deletes, the regular expressions can be combined using the zoom operator (Regexp#>).
Specifies the execution of the set of productions prod_list.
Specifies the change of all the occurrences of the pattern expressed by the reg_exp regular expression to the text string. Optionally, a substitution can be named using the name string. To build complex substitution patterns, the regular expressions can be combined using the zoom operator (Regexp#>).
Specifies the application of a set of substitutions (sub_list) on an input file (i_file) to produce an output file (o_file).
Specifies the change of the first occurrence of the pattern expressed by the reg_exp regular expression to the text string. Optionally, a substitution can be named using the name string. To build complex substitution patterns, the regular expressions can be combined using the zoom operator (Regexp#>).