Module: Rubyang::Model

Defined in:
lib/rubyang/model.rb,
lib/rubyang/model/logger.rb,
lib/rubyang/model/parser.rb,
lib/rubyang/model/parser/parser.tab.rb

Defined Under Namespace

Classes: Anyxml, ArgStmt, Argument, Augment, Base, BaseStmt, BelongsTo, Bit, Case, Choice, Config, ConformanceRelated, Contact, Container, Default, Description, Deviate, Deviation, Enum, ErrorAppTag, ErrorMessage, Extension, Feature, FractionDigits, Grouping, Identity, Identityref, IfFeature, Import, Include, Input, Key, Leaf, LeafList, Leafref, Length, List, Logger, Mandatory, MaxElements, MinElements, Module, Must, Namespace, NoArgStmt, Notification, OrderedBy, Organization, Output, Parser, Path, Pattern, Position, Prefix, Presence, Range, Reference, Refine, RequireInstance, Revision, RevisionDate, Rpc, Status, StmtMap, Submodule, Type, Typedef, Union, Unique, Units, Unknown, Uses, Value, When, YangVersion, YinElement

Instance Method Summary collapse

Instance Method Details

#absolute_schema_nodeidObject



17
18
19
# File 'lib/rubyang/model.rb', line 17

def absolute_schema_nodeid
  "(?:(?:/#{node_identifier})+)"
end

#descendant_schema_nodeidObject



20
21
22
# File 'lib/rubyang/model.rb', line 20

def descendant_schema_nodeid
  "(?:#{node_identifier}#{absolute_schema_nodeid})"
end

#dquoteObject



44
45
46
# File 'lib/rubyang/model.rb', line 44

def dquote
  '"'
end

#identifierObject



41
42
43
# File 'lib/rubyang/model.rb', line 41

def identifier
  '(?:[a-zA-Z][a-zA-Z0-9._-]*)'
end

#instance_identifierObject



26
27
28
# File 'lib/rubyang/model.rb', line 26

def instance_identifier
  "(?:(?:/#{node_identifier}(?:#{predicate})*)+)"
end

#node_identifierObject



23
24
25
# File 'lib/rubyang/model.rb', line 23

def node_identifier
  "(?:(?:#{prefix}:)?#{identifier})"
end

#posObject



35
36
37
# File 'lib/rubyang/model.rb', line 35

def pos
  '(?:[0-9]+)'
end

#predicateObject



29
30
31
# File 'lib/rubyang/model.rb', line 29

def predicate
  "(?:\[#{wsp}*(?:#{predicate_expr}|#{pos})#{wsp}*\])"
end

#predicate_exprObject



32
33
34
# File 'lib/rubyang/model.rb', line 32

def predicate_expr
  "(?:(?:#{node_identifier}|[.])#{wsp}*=#{wsp}*(?:(?:#{dquote}[^#{dquote}]*#{dquote})|(?:#{squote}[^#{squote}]*#{squote})))"
end

#prefixObject



38
39
40
# File 'lib/rubyang/model.rb', line 38

def prefix
  "(?:#{identifier})"
end

#schema_nodeidObject



14
15
16
# File 'lib/rubyang/model.rb', line 14

def schema_nodeid
  "(?:#{absolute_schema_nodeid}|#{descendant_schema_nodeid})"
end

#squoteObject



47
48
49
# File 'lib/rubyang/model.rb', line 47

def squote
  "'"
end

#wspObject



50
51
52
# File 'lib/rubyang/model.rb', line 50

def wsp
  '(?:[ \t])'
end