2010-11-15 20:35:36 +00:00
|
|
|
/* ========================================================================
|
|
|
|
* PlantUML : a free UML diagram generator
|
|
|
|
* ========================================================================
|
|
|
|
*
|
2016-01-09 12:15:40 +00:00
|
|
|
* (C) Copyright 2009-2017, Arnaud Roques
|
2010-11-15 20:35:36 +00:00
|
|
|
*
|
2016-03-06 16:47:34 +00:00
|
|
|
* Project Info: http://plantuml.com
|
2010-11-15 20:35:36 +00:00
|
|
|
*
|
2017-03-15 19:13:31 +00:00
|
|
|
* If you like this project or if you find it useful, you can support us at:
|
|
|
|
*
|
|
|
|
* http://plantuml.com/patreon (only 1$ per month!)
|
|
|
|
* http://plantuml.com/paypal
|
|
|
|
*
|
2010-11-15 20:35:36 +00:00
|
|
|
* This file is part of PlantUML.
|
|
|
|
*
|
|
|
|
* PlantUML is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* PlantUML distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
2013-12-10 19:36:50 +00:00
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
2010-11-15 20:35:36 +00:00
|
|
|
* License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Original Author: Arnaud Roques
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2013-12-10 19:36:50 +00:00
|
|
|
package net.sourceforge.plantuml.syntax;
|
2010-11-15 20:35:36 +00:00
|
|
|
|
|
|
|
import java.io.PrintStream;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.TreeSet;
|
|
|
|
|
2013-12-10 19:36:50 +00:00
|
|
|
import net.sourceforge.plantuml.SkinParam;
|
2015-04-07 18:18:37 +00:00
|
|
|
import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
|
2010-11-15 20:35:36 +00:00
|
|
|
|
|
|
|
public class LanguageDescriptor {
|
|
|
|
|
|
|
|
private final Set<String> type = new TreeSet<String>();
|
|
|
|
private final Set<String> keyword = new TreeSet<String>();
|
|
|
|
private final Set<String> preproc = new TreeSet<String>();
|
|
|
|
|
|
|
|
public LanguageDescriptor() {
|
2013-12-10 19:36:50 +00:00
|
|
|
|
2010-11-15 20:35:36 +00:00
|
|
|
type.add("actor");
|
|
|
|
type.add("participant");
|
|
|
|
type.add("usecase");
|
|
|
|
type.add("class");
|
|
|
|
type.add("interface");
|
|
|
|
type.add("abstract");
|
|
|
|
type.add("enum");
|
|
|
|
type.add("component");
|
|
|
|
type.add("state");
|
|
|
|
type.add("object");
|
2013-12-10 19:36:50 +00:00
|
|
|
type.add("artifact");
|
|
|
|
type.add("folder");
|
2017-01-21 22:25:28 +00:00
|
|
|
type.add("rectangle");
|
2013-12-10 19:36:50 +00:00
|
|
|
type.add("node");
|
|
|
|
type.add("frame");
|
|
|
|
type.add("cloud");
|
|
|
|
type.add("database");
|
|
|
|
type.add("storage");
|
|
|
|
type.add("agent");
|
2017-05-10 19:51:15 +00:00
|
|
|
type.add("stack");
|
2013-12-10 19:36:50 +00:00
|
|
|
type.add("boundary");
|
|
|
|
type.add("control");
|
|
|
|
type.add("entity");
|
2015-04-07 18:18:37 +00:00
|
|
|
type.add("card");
|
2017-01-21 22:25:28 +00:00
|
|
|
type.add("file");
|
|
|
|
type.add("package");
|
|
|
|
type.add("queue");
|
2017-07-03 17:59:53 +00:00
|
|
|
type.add("archimate");
|
2010-11-15 20:35:36 +00:00
|
|
|
|
|
|
|
keyword.add("@startuml");
|
|
|
|
keyword.add("@enduml");
|
2017-01-21 22:25:28 +00:00
|
|
|
keyword.add("@startdot");
|
|
|
|
keyword.add("@enddot");
|
|
|
|
keyword.add("@startsalt");
|
|
|
|
keyword.add("@endsalt");
|
2010-11-15 20:35:36 +00:00
|
|
|
keyword.add("as");
|
2013-12-10 19:36:50 +00:00
|
|
|
keyword.add("also");
|
2010-11-15 20:35:36 +00:00
|
|
|
keyword.add("autonumber");
|
2016-01-30 12:20:07 +00:00
|
|
|
keyword.add("caption");
|
2010-11-15 20:35:36 +00:00
|
|
|
keyword.add("title");
|
|
|
|
keyword.add("newpage");
|
|
|
|
keyword.add("box");
|
|
|
|
keyword.add("alt");
|
|
|
|
keyword.add("else");
|
|
|
|
keyword.add("opt");
|
|
|
|
keyword.add("loop");
|
|
|
|
keyword.add("par");
|
|
|
|
keyword.add("break");
|
|
|
|
keyword.add("critical");
|
|
|
|
keyword.add("note");
|
2015-09-06 17:28:59 +00:00
|
|
|
keyword.add("rnote");
|
|
|
|
keyword.add("hnote");
|
|
|
|
keyword.add("legend");
|
2010-11-15 20:35:36 +00:00
|
|
|
keyword.add("group");
|
|
|
|
keyword.add("left");
|
|
|
|
keyword.add("right");
|
|
|
|
keyword.add("of");
|
2013-12-10 19:36:50 +00:00
|
|
|
keyword.add("on");
|
|
|
|
keyword.add("link");
|
2010-11-15 20:35:36 +00:00
|
|
|
keyword.add("over");
|
|
|
|
keyword.add("end");
|
|
|
|
keyword.add("activate");
|
|
|
|
keyword.add("deactivate");
|
|
|
|
keyword.add("destroy");
|
|
|
|
keyword.add("create");
|
|
|
|
keyword.add("footbox");
|
|
|
|
keyword.add("hide");
|
|
|
|
keyword.add("show");
|
|
|
|
keyword.add("skinparam");
|
|
|
|
keyword.add("skin");
|
|
|
|
keyword.add("top");
|
|
|
|
keyword.add("bottom");
|
|
|
|
keyword.add("top to bottom direction");
|
|
|
|
keyword.add("package");
|
|
|
|
keyword.add("namespace");
|
|
|
|
keyword.add("page");
|
|
|
|
keyword.add("up");
|
|
|
|
keyword.add("down");
|
|
|
|
keyword.add("if");
|
|
|
|
keyword.add("else");
|
2015-04-07 18:18:37 +00:00
|
|
|
keyword.add("elseif");
|
2010-11-15 20:35:36 +00:00
|
|
|
keyword.add("endif");
|
|
|
|
keyword.add("partition");
|
|
|
|
keyword.add("footer");
|
|
|
|
keyword.add("header");
|
|
|
|
keyword.add("center");
|
|
|
|
keyword.add("rotate");
|
2011-08-08 17:48:29 +00:00
|
|
|
keyword.add("ref");
|
2013-12-10 19:36:50 +00:00
|
|
|
keyword.add("return");
|
|
|
|
keyword.add("is");
|
|
|
|
keyword.add("repeat");
|
|
|
|
keyword.add("start");
|
|
|
|
keyword.add("stop");
|
|
|
|
keyword.add("while");
|
|
|
|
keyword.add("endwhile");
|
|
|
|
keyword.add("fork");
|
|
|
|
keyword.add("again");
|
2015-04-07 18:18:37 +00:00
|
|
|
keyword.add("kill");
|
2010-11-15 20:35:36 +00:00
|
|
|
|
|
|
|
preproc.add("!include");
|
2017-01-21 22:25:28 +00:00
|
|
|
preproc.add("!pragma");
|
2010-11-15 20:35:36 +00:00
|
|
|
preproc.add("!define");
|
|
|
|
preproc.add("!undef");
|
2017-06-05 11:27:21 +00:00
|
|
|
preproc.add("!if");
|
2010-11-15 20:35:36 +00:00
|
|
|
preproc.add("!ifdef");
|
|
|
|
preproc.add("!endif");
|
|
|
|
preproc.add("!ifndef");
|
2016-12-01 20:29:25 +00:00
|
|
|
preproc.add("!else");
|
|
|
|
preproc.add("!definelong");
|
|
|
|
preproc.add("!enddefinelong");
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void print(PrintStream ps) {
|
|
|
|
print(ps, "type", type);
|
|
|
|
print(ps, "keyword", keyword);
|
|
|
|
print(ps, "preprocessor", preproc);
|
|
|
|
print(ps, "skinparameter", SkinParam.getPossibleValues());
|
2015-04-07 18:18:37 +00:00
|
|
|
print(ps, "color", new HtmlColorSetSimple().names());
|
2010-11-15 20:35:36 +00:00
|
|
|
ps.println(";EOF");
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void print(PrintStream ps, String name, Collection<String> data) {
|
|
|
|
ps.println(";"+name);
|
|
|
|
ps.println(";" + data.size());
|
|
|
|
for (String k : data) {
|
|
|
|
ps.println(k);
|
|
|
|
}
|
|
|
|
ps.println();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|