Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compile/RuleCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ private void fixUniqOrder()
/** 否定条件をコンパイルする */
void compileNegatives() throws CompileException
{
Iterator<List<ProcessContextEquation>> it = rs.guardNegatives.iterator();
Iterator<LinkedList<ProcessContextEquation>> it = rs.guardNegatives.iterator();
while (it.hasNext())
{
List<ProcessContextEquation> eqs = it.next();
Expand Down
170 changes: 86 additions & 84 deletions src/compile/parser/LMNParser.java

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/compile/parser/SrcAbstract.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package compile.parser;

/**
* ソースコード中のアトムや膜などからなる抽象クラス。
*/
abstract class SrcAbstract
{

}
14 changes: 7 additions & 7 deletions src/compile/parser/SrcAtom.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.util.LinkedList;

/** ソースファイル中のアトム表現 */
class SrcAtom
class SrcAtom extends SrcAbstract
{
protected LinkedList process = null;
protected LinkedList<SrcAbstract> process = null;

/** 名前トークン */
protected SrcName srcname;
Expand Down Expand Up @@ -37,15 +37,15 @@ public SrcAtom(String name)
*/
public SrcAtom(SrcName srcname)
{
this(srcname, new LinkedList(), -1,-1);
this(srcname, new LinkedList<>(), -1,-1);
}

/**
* 指定された名前と子供プロセスで初期化します
* @param name アトム名
* @param process 子供プロセス
*/
public SrcAtom(String name, LinkedList process)
public SrcAtom(String name, LinkedList<SrcAbstract> process)
{
this(new SrcName(name), process, -1,-1);
}
Expand All @@ -59,7 +59,7 @@ public SrcAtom(String name, LinkedList process)
*/
public SrcAtom(SrcName srcname, int line, int column)
{
this(srcname, new LinkedList(), line, column);
this(srcname, new LinkedList<>(), line, column);
}

/**
Expand All @@ -70,7 +70,7 @@ public SrcAtom(SrcName srcname, int line, int column)
* @param line ソースコード上での出現位置(行)
* @param column ソースコード上での出現位置(桁)
*/
public SrcAtom(SrcName nametoken, LinkedList process, int line, int column)
public SrcAtom(SrcName nametoken, LinkedList<SrcAbstract> process, int line, int column)
{
this.srcname = nametoken;
this.process = process;
Expand Down Expand Up @@ -111,7 +111,7 @@ public int getNameType()
* このアトムの子プロセスを得ます
* @return 子プロセスのリスト
*/
public LinkedList getProcess()
public LinkedList<SrcAbstract> getProcess()
{
return process;
}
Expand Down
2 changes: 1 addition & 1 deletion src/compile/parser/SrcContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* ソースファイル中のリンク・リンク束・プロセスコンテキスト・ルールコンテキストの抽象親クラス
* <p>プロセス文脈名およびルール文脈名には '...' や [[...]] が使えないようにした。
*/
abstract class SrcContext
abstract class SrcContext extends SrcAbstract
{
protected String name = null;
protected int lineno = -1;
Expand Down
10 changes: 5 additions & 5 deletions src/compile/parser/SrcMembrane.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
/**
* ソースファイル中の膜表現
*/
class SrcMembrane
class SrcMembrane extends SrcAbstract
{
/** 膜の内容プロセスの表現 */
LinkedList process = null;
LinkedList<SrcAbstract> process = null;

/** 終了フラグの有無 */
public boolean stable = false;
Expand All @@ -27,14 +27,14 @@ class SrcMembrane
*/
public SrcMembrane()
{
this(new LinkedList());
this(new LinkedList<SrcAbstract>());
}

/**
* 指定された子プロセスを持つ膜を作成します
* @param process 膜に含まれる子プロセス
*/
public SrcMembrane(LinkedList process)
public SrcMembrane(LinkedList<SrcAbstract> process)
{
this.process = process;
}
Expand All @@ -43,7 +43,7 @@ public SrcMembrane(LinkedList process)
* 子プロセスを取得します
* @return 子プロセスのリスト
*/
public LinkedList getProcess()
public LinkedList<SrcAbstract> getProcess()
{
return process;
}
Expand Down
4 changes: 2 additions & 2 deletions src/compile/parser/SrcProcessContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SrcProcessContext extends SrcContext
public SrcLinkBundle bundle = null;

/** 分離した同名型付きプロセス文脈の名前を格納 */
public LinkedList sameNameList = null;
public LinkedList<String> sameNameList = null;

/** リンク名 */
public String linkName = null;
Expand Down Expand Up @@ -51,7 +51,7 @@ public String getQualifiedName()
return "$" + name;
}

public LinkedList getSameNameList()
public LinkedList<String> getSameNameList()
{
return sameNameList;
}
Expand Down
12 changes: 12 additions & 0 deletions src/compile/parser/SrcProcessList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package compile.parser;

import java.util.LinkedList;

class SrcProcessList extends SrcAbstract
{
LinkedList<SrcAbstract> list;

SrcProcessList(LinkedList<SrcAbstract> list) {
this.list = list;
}
}
Loading