jp.hishidama.eval.lex.comment
クラス CommentLex

java.lang.Object
  上位を拡張 jp.hishidama.eval.lex.comment.CommentLex
直系の既知のサブクラス:
BlockComment, LineComment

public abstract class CommentLex
extends Object

コメント解釈クラス.

コメントの開始・終了を解釈する。

導入されたバージョン:
eval16
作成者:
ひしだま

メソッドの概要
 String getTopString()
          開始文字列取得.
abstract  int isEnd(String string, int pos)
          終了文字列と一致しているか.
 int isTop(String string, int pos)
          開始文字列と一致しているか.
 int skip(String string, int pos)
          コメントスキップ.
 int topLength()
          開始文字列長取得.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

isTop

public int isTop(String string,
                 int pos)
開始文字列と一致しているか.

パラメータ:
string - 対象文字列
pos - 位置
戻り値:
0以上:一致している文字数、負:一致していない

isEnd

public abstract int isEnd(String string,
                          int pos)
終了文字列と一致しているか.

パラメータ:
string - 対象文字列
pos - 位置
戻り値:
0以上:一致している文字数、負:一致していない

getTopString

public String getTopString()
開始文字列取得.

戻り値:
開始文字列

topLength

public int topLength()
開始文字列長取得.

戻り値:
開始文字列の長さ

skip

public int skip(String string,
                int pos)
コメントスキップ.

パラメータ:
string - 対象文字列
pos - スキップ開始位置
戻り値:
コメントの次の文字の位置(負の場合、コメントが終了せずに文字列が終わった)