Commit 83188fa5 authored by Théotime BOLLENGIER's avatar Théotime BOLLENGIER
Browse files

blifosate compatibility

parent be06a2fd
# Copyright (C) 2017-2018 ENSTA Bretagne
# Autogenerated from a Treetop grammar. Edits may be lost.
# Author: Théotime Bollengier <theotime.bollengier@ensta-bretagne.fr>
#
# This file is part of ArGen. <https://gitlab.ensta-bretagne.fr/argen/argen>
#
......@@ -15,7 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with ArGen. If not, see <http://www.gnu.org/licenses/>.
# Autogenerated from a Treetop grammar. Edits may be lost.
#
# Treetop Grammar to parse VPR route files
......@@ -1380,6 +1383,13 @@ module VprRoutes
r0
end
module NetName0
def net_name
elements[2]
end
end
def _nt_net_name
start_index = index
if node_cache[:net_name].has_key?(index)
......@@ -1391,26 +1401,102 @@ module VprRoutes
return cached
end
s0, i0 = [], index
i0 = index
i1, s1 = index, []
s2, i2 = [], index
loop do
if has_terminal?(@regexps[gr = '\A[\\w:\\[\\]\\|\\.]'] ||= Regexp.new(gr), :regexp, index)
r1 = true
r3 = true
@index += 1
else
terminal_parse_failure('[\\w:\\[\\]\\|\\.]')
r1 = nil
r3 = nil
end
if r1
s0 << r1
if r3
s2 << r3
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
if s2.empty?
@index = i2
r2 = nil
else
r0 = instantiate_node(ArGen::VprRoutes::NetName,input, i0...index, s0)
r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
end
s1 << r2
if r2
if (match_len = has_terminal?('(', false, index))
r4 = true
@index += match_len
else
terminal_parse_failure('\'(\'')
r4 = nil
end
s1 << r4
if r4
r5 = _nt_net_name
s1 << r5
if r5
if (match_len = has_terminal?(')', false, index))
r6 = true
@index += match_len
else
terminal_parse_failure('\')\'')
r6 = nil
end
s1 << r6
if r6
r8 = _nt_net_name
if r8
r7 = r8
else
r7 = instantiate_node(SyntaxNode,input, index...index)
end
s1 << r7
end
end
end
end
if s1.last
r1 = instantiate_node(ArGen::VprRoutes::NetName,input, i1...index, s1)
r1.extend(NetName0)
else
@index = i1
r1 = nil
end
if r1
r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
r0 = r1
else
s9, i9 = [], index
loop do
if has_terminal?(@regexps[gr = '\A[\\w:\\[\\]\\|\\.]'] ||= Regexp.new(gr), :regexp, index)
r10 = true
@index += 1
else
terminal_parse_failure('[\\w:\\[\\]\\|\\.]')
r10 = nil
end
if r10
s9 << r10
else
break
end
end
if s9.empty?
@index = i9
r9 = nil
else
r9 = instantiate_node(ArGen::VprRoutes::NetName,input, i9...index, s9)
end
if r9
r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
r0 = r9
else
@index = i0
r0 = nil
end
end
node_cache[:net_name][start_index] = r0
......
......@@ -71,6 +71,8 @@ grammar VprRoutes
rule net_name
[\w:\[\]\|\.]+ '(' net_name ')' net_name? <ArGen::VprRoutes::NetName>
/
[\w:\[\]\|\.]+ <ArGen::VprRoutes::NetName>
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment