void TranslateToHexViewPosition(ref PegBegEnd stretch)
 {
     int len = stretch.Length;
     TranslateToHexViewPosition(ref stretch.posBeg_);
     if (len > 0) --stretch.posEnd_;
     TranslateToHexViewPosition(ref stretch.posEnd_);
     stretch.posEnd_ += 2;
 }
Beispiel #2
0
 public bool Into(Matcher toMatch,out PegBegEnd begEnd)
 {
     begEnd.posBeg_ = pos_;
     bool bMatches = toMatch();
     begEnd.posEnd_ = pos_;
     return bMatches;
 }
 void ShowLocation(PegBegEnd stretch)
 {
     if (stretch.posBeg_ < 0) return;
     if (txtSource.Tag != null && (txtSource.Tag as SourcefileInfo).EncodingClass == EncodingClass.binary)//hex view present in txtSource
     {
         TranslateToHexViewPosition(ref stretch);
     }
     txtSource.Select(stretch.posBeg_, stretch.posEnd_ - stretch.posBeg_);
     txtSource.ScrollToCaret();
 }
Beispiel #4
0
 public PegNode(PegNode parent, int id, PegBegEnd match, PegNode child)
     : this(parent, id, match, child, null)
 {
 }
Beispiel #5
0
 public PegNode(PegNode parent, int id, PegBegEnd match)
     : this(parent, id, match, null, null)
 { }
 internal IntValue(PegNode parent, int id, PegBegEnd match, int val)
     : base(parent,id,match)
 {
     value_= val;
 }
Beispiel #7
0
 public PegNode(PegNode parent, int id, PegBegEnd match, PegNode child, PegNode next)
 {
     parent_ = parent; id_ = id; child_ = child; next_ = next;
     match_ = match;
 }
 internal TRepetition(int nLowerLimit, int nUpperLimit, EPegGrammar id, PegBegEnd begEnd)
     : base(null, (int)id)
 {
     base.match_ = begEnd;
     lower = nLowerLimit;
     upper = nUpperLimit;
 }
 PegNode NewFatal(string sMsg, PegBegEnd match)
 {
     return new Message(null, (int)EPegGeneratorNodes.FatalNode, sMsg, match);
 }
 internal Message(PegNode parent, int id, string message, PegBegEnd match)
     : base(parent, id)
 {
     message_ = message;
     base.match_ = match;
 }
 internal IdNode(PegNode parent, int id, int ownId, PegBegEnd match, PegNode next)
     : base(parent, id)
 {
     ownId_ = ownId;
     base.match_ = match;
     next_ = next;
 }
 PegNode NewNode(
                     EPegGrammar id,
                     PegBegEnd match,
                     PegNode child)
 {
     return NewNode(id, match, child, null);
 }
 PegNode NewNode(
                     EPegGrammar id,
                     PegBegEnd match)
 {
     return NewNode(id, match, null, null);
 }
 PegNode NewNode(
                     EPegGrammar id,
                     PegBegEnd match,
                     PegNode child,
                     PegNode next)
 {
     PegNode n = new PegNode(null, (int)id);
     n.match_ = match;
     n.child_ = child;
     n.next_ = next;
     for (PegNode node = n.child_; node != null; node = node.next_) node.parent_ = n;
     return n;
 }