-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
396 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/main/java/com/viklauverk/eventbtools/core/RenderOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
Copyright (C) 2021-2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
import java.util.List; | ||
import java.util.LinkedList; | ||
|
||
import com.viklauverk.eventbtools.core.Formula; | ||
|
||
public class RenderOperator extends CommonRenderFunctions | ||
{ | ||
public void visit_OperatorStart(Operator oprt) { } | ||
|
||
public void visit_HeadingComplete(Operator oprt) { } | ||
|
||
public void visit_OperatorEnd(Operator oprt) { } | ||
|
||
protected String buildOperatorPartName(Operator oprt) | ||
{ | ||
return oprt.theory().name()+"/"+oprt.name(); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
src/main/java/com/viklauverk/eventbtools/core/RenderOperatorUnicode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
Copyright (C) 2021-2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
public class RenderOperatorUnicode extends RenderOperator | ||
{ | ||
@Override | ||
public void visit_OperatorStart(Operator oprt) | ||
{ | ||
String id = buildOperatorPartName(oprt); | ||
|
||
cnvs().marker(id); | ||
|
||
cnvs().startLine(); | ||
if (oprt.notation() == OperatorNotationType.PREFIX) | ||
{ | ||
cnvs().keywordLeft("prefix "); | ||
} | ||
if (oprt.notation() == OperatorNotationType.INFIX) | ||
{ | ||
cnvs().keywordLeft("infix "); | ||
} | ||
cnvs().keywordLeft("operator "); | ||
cnvs().id(oprt.name()); | ||
cnvs().endLine(); | ||
|
||
if (oprt.hasComment()) | ||
{ | ||
cnvs().acomment(oprt.comment()); | ||
} | ||
} | ||
|
||
@Override | ||
public void visit_HeadingComplete(Operator oprt) | ||
{ | ||
} | ||
|
||
@Override | ||
public void visit_OperatorEnd(Operator oprt) | ||
{ | ||
cnvs().startLine(); | ||
cnvs().keyword("end"); | ||
cnvs().endLine(); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/com/viklauverk/eventbtools/core/RenderPolymorphicDataType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
Copyright (C) 2021-2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
import java.util.List; | ||
import java.util.LinkedList; | ||
|
||
import com.viklauverk.eventbtools.core.Formula; | ||
|
||
public class RenderPolymorphicDataType extends CommonRenderFunctions | ||
{ | ||
public void visit_PolymorphicDataTypeStart(PolymorphicDataType pdt) { } | ||
|
||
public void visit_HeadingComplete(PolymorphicDataType pdt) { } | ||
|
||
public void visit_ConstructorsStart(PolymorphicDataType pdt) { } | ||
public void visit_Constructor(PolymorphicDataType pdt, Constructor cnstr) { } | ||
public void visit_ConstructorsEnd(PolymorphicDataType pdt) { } | ||
|
||
public void visit_PolymorphicDataTypeEnd(PolymorphicDataType pdt) { } | ||
|
||
protected String buildPolymorphicDataTypePartName(PolymorphicDataType pdt) | ||
{ | ||
return pdt.theory().name()+"/"+pdt.baseName(); | ||
} | ||
|
||
protected String buildConstructorsPartName(PolymorphicDataType pdt) | ||
{ | ||
return pdt.theory().name()+"/"+pdt.baseName()+"/constructors"; | ||
} | ||
|
||
protected String buildConstructorPartName(PolymorphicDataType pdt, Constructor cnstr) | ||
{ | ||
return pdt.theory().name()+"/"+pdt.baseName()+"/constructor/"+cnstr.name(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/viklauverk/eventbtools/core/RenderPolymorphicDataTypeHtmq.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Copyright (C) 2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
public class RenderPolymorphicDataTypeHtmq extends RenderPolymorphicDataTypeUnicode | ||
{ | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/viklauverk/eventbtools/core/RenderPolymorphicDataTypeSearch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
Copyright (C) 2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
public class RenderPolymorphicDataTypeSearch extends RenderPolymorphicDataType | ||
{ | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/viklauverk/eventbtools/core/RenderPolymorphicDataTypeTeX.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
Copyright (C) 2021-2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
public class RenderPolymorphicDataTypeTeX extends RenderPolymorphicDataTypeUnicode | ||
{ | ||
@Override | ||
public void visit_PolymorphicDataTypeStart(PolymorphicDataType pdt) | ||
{ | ||
cnvs().append("\\subsection{\\footnotesize "); | ||
cnvs().set(pdt.longName()); | ||
cnvs().append(" "); | ||
cnvs().append("}\n"); | ||
super.visit_PolymorphicDataTypeStart(pdt); | ||
} | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
src/main/java/com/viklauverk/eventbtools/core/RenderPolymorphicDataTypeUnicode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
Copyright (C) 2021-2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
public class RenderPolymorphicDataTypeUnicode extends RenderPolymorphicDataType | ||
{ | ||
@Override | ||
public void visit_PolymorphicDataTypeStart(PolymorphicDataType pdt) | ||
{ | ||
String id = buildPolymorphicDataTypePartName(pdt); | ||
|
||
cnvs().marker(id); | ||
|
||
if (pdt.hasComment()) | ||
{ | ||
cnvs().acomment(pdt.comment()); | ||
} | ||
cnvs().startLine(); | ||
cnvs().id(pdt.longName()); | ||
cnvs().endLine(); | ||
} | ||
|
||
@Override | ||
public void visit_ConstructorsStart(PolymorphicDataType pdt) | ||
{ | ||
cnvs().startLine(); | ||
cnvs().keywordLeft("► "); | ||
cnvs().space(); | ||
} | ||
|
||
@Override | ||
public void visit_Constructor(PolymorphicDataType pdt, Constructor cnstr) | ||
{ | ||
//renders().walkConstructor(pdt, ""); | ||
} | ||
|
||
@Override | ||
public void visit_ConstructorsEnd(PolymorphicDataType pdt) | ||
{ | ||
cnvs().endLine(); | ||
} | ||
|
||
@Override | ||
public void visit_HeadingComplete(PolymorphicDataType pdt) | ||
{ | ||
} | ||
|
||
@Override | ||
public void visit_PolymorphicDataTypeEnd(PolymorphicDataType pdt) | ||
{ | ||
cnvs().startLine(); | ||
cnvs().keyword("end"); | ||
cnvs().endLine(); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/com/viklauverk/eventbtools/core/VisitPolymorphicDataType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright (C) 2021-2024 Viklauverk AB | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.viklauverk.eventbtools.core; | ||
|
||
import java.util.List; | ||
import java.util.LinkedList; | ||
|
||
import com.viklauverk.eventbtools.core.Formula; | ||
|
||
public class VisitPolymorphicDataType | ||
{ | ||
public static void walk(RenderPolymorphicDataType re, PolymorphicDataType pdt, String pattern) | ||
{ | ||
String path = pdt.theory().name()+"/datatypes/"+pdt.baseName()+"/"; | ||
boolean m = Util.match(path, pattern); | ||
|
||
if (m) re.visit_PolymorphicDataTypeStart(pdt); | ||
|
||
if (m) re.visit_HeadingComplete(pdt); | ||
|
||
if (pdt.hasConstructors()) | ||
{ | ||
if (m) re.visit_ConstructorsStart(pdt); | ||
for (Constructor cnstr : pdt.constructorOrdering()) | ||
{ | ||
boolean pp = Util.match(path+"constructors/"+cnstr.name()+"/", pattern); | ||
if (pp) re.visit_Constructor(pdt, cnstr); | ||
} | ||
if (m) re.visit_ConstructorsEnd(pdt); | ||
} | ||
|
||
if (m) re.visit_PolymorphicDataTypeEnd(pdt); | ||
} | ||
} |
Oops, something went wrong.