lexical_analyzer 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 273933b2287cdeb8b2b222f6e7300be549035466
4
- data.tar.gz: 07a210f72d942e13e5e6f399a3d51738eac9eb15
3
+ metadata.gz: 9dd35696f4d5750cc7ea28dbd6da1fea8ac798bb
4
+ data.tar.gz: 62643fad63d6447ff424591674a15b86e9e380ad
5
5
  SHA512:
6
- metadata.gz: a0cbcf9971f958e2da32f3b86504a857c9e0dd326e6167be41b256c8dc0356eafd38c7fdf0b45f7a598ac88ab3b8aa943eceebb7c22a7f2e3440d8d48ddea3a8
7
- data.tar.gz: 7df681c1106a6009443228ade75c3b26935b82695b89baeb8d64db62e8f81cbdeb5045dbcb4a8d5de6b84738d103b863a2a27cc464aa84673cf8c88feaa80416
6
+ metadata.gz: 1d712d947aba827f92e780b4dc8a2d0b2cc8d65eb58cc31857b1c6521f9402e02b95c0059259de969bad5896c1946d3080b7cdd5da950fdb76c8ba8b20e4d167
7
+ data.tar.gz: efee0aedb08edeaed16acced97b2531c95ffced80ef42b2806bb6caf2e40ae90e5a584ac6ff72ff9cc4bf7d46cf3528656cb9fc837747f6c868ee4b2cb9af013
data/README.md CHANGED
@@ -1,10 +1,21 @@
1
1
  # LexicalAnalyzer
2
2
 
3
- The lexical analyzer is a component of the Ruby Compiler Toolkit Project that
4
- scans an input text against an array of rules and generating the lexical
5
- tokens that it detects. It is normally used in conjunction with a parse queue
6
- object which handles queuing of tokens and back tracking of the compile process
7
- when needed.
3
+ The lexical analyzer is a component of the Ruby Compiler Toolkit Project (rctp)
4
+ that scans an input text against an array of rules and generating the lexical
5
+ tokens that it detects. This process is shown below:
6
+
7
+ ![The Lexical Process](./images/lexical_process.png)
8
+
9
+ In general, each time the lexical_analyzer receives the "get" message, it tries
10
+ to extract another token from the source text. As such, the lexical analyzer
11
+ gem component is the first stage of the compilation process for a compiler
12
+ built using the rctp. With its array of lexical rules it provides the language
13
+ tokens needed to operate the compiler's parser.
14
+
15
+ The lexical analyzer is normally used in conjunction with a parse queue object
16
+ which handles queuing of tokens and back tracking of the compile process when
17
+ needed. In the rcpt this is done by the gem
18
+ [parse_queue](https://github.com/PeterCamilleri/parse_queue).
8
19
 
9
20
  ## Installation
10
21
 
@@ -76,10 +87,14 @@ Notes:
76
87
 
77
88
  * The regular expression must begin with a \A clause to ensure correct
78
89
  operation of the analyzer.
90
+ * An exception to the above is the use of the expression /.+/ at the end of the
91
+ rule list as a sort of lexical "else" catch-all clause.
79
92
  * The order of rules is important. For example, if there are two rules
80
93
  looking for "==" and "=" respectively, if the "=" is ahead of the "==" rule
81
94
  in the array the "==" rule will never trigger and the analysis will be
82
95
  incorrect.
96
+ * The method LexicalRule#symbol is a read accessor for the symbol property of
97
+ the lexical rule.
83
98
 
84
99
  #### Tokens
85
100
 
Binary file
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.required_ruby_version = '>=2.3.0'
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.15"
23
- spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rake", ">= 12.3.3"
24
24
  spec.add_development_dependency "minitest", "~> 5.0"
25
25
  spec.add_development_dependency 'minitest_visible', "~> 0.1"
26
26
  spec.add_development_dependency 'reek', "~> 5.0.2"
@@ -1,3 +1,3 @@
1
1
  class LexicalAnalyzer
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lexical_analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PeterCamilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2020-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -92,6 +92,7 @@ files:
92
92
  - Gemfile
93
93
  - LICENSE.txt
94
94
  - README.md
95
+ - images/lexical_process.png
95
96
  - lexical_analyzer.gemspec
96
97
  - lib/lexical_analyzer.rb
97
98
  - lib/lexical_analyzer/lexical_rule.rb