diff options
author | Christopher Hoskin <mans0954@debian.org> | 2017-09-08 19:57:06 +0100 |
---|---|---|
committer | Christopher Hoskin <mans0954@debian.org> | 2017-09-08 19:57:06 +0100 |
commit | 277c886dbbaa9ac62798e87272c7ead5795033f8 (patch) | |
tree | 309f666741dddb2f914ab224d98b6ca32d8e228a /src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java | |
parent | f9dab4abce6df0e9b5121895cc6e94823c2dece3 (diff) |
New upstream version 1.2017.15
Diffstat (limited to 'src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java')
-rw-r--r-- | src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java | 353 |
1 files changed, 184 insertions, 169 deletions
diff --git a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java index f02a5cf..f4dfb0a 100644 --- a/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java +++ b/src/net/sourceforge/plantuml/syntax/LanguageDescriptor.java @@ -1,169 +1,184 @@ -/* ========================================================================
- * PlantUML : a free UML diagram generator
- * ========================================================================
- *
- * (C) Copyright 2009-2017, Arnaud Roques
- *
- * Project Info: http://plantuml.com
- *
- * This file is part of PlantUML.
- *
- * Licensed under The MIT License (Massachusetts Institute of Technology License)
- *
- * See http://opensource.org/licenses/MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
- * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *
- * Original Author: Arnaud Roques
- */
-package net.sourceforge.plantuml.syntax;
-
-import java.io.PrintStream;
-import java.util.Collection;
-import java.util.Set;
-import java.util.TreeSet;
-
-import net.sourceforge.plantuml.SkinParam;
-import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
-
-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() {
-
- 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");
- type.add("artifact");
- type.add("folder");
- type.add("rect");
- type.add("node");
- type.add("frame");
- type.add("cloud");
- type.add("database");
- type.add("storage");
- type.add("agent");
- type.add("boundary");
- type.add("control");
- type.add("entity");
- type.add("card");
-
- keyword.add("@startuml");
- keyword.add("@enduml");
- keyword.add("as");
- keyword.add("also");
- keyword.add("autonumber");
- keyword.add("caption");
- 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");
- keyword.add("rnote");
- keyword.add("hnote");
- keyword.add("legend");
- keyword.add("group");
- keyword.add("left");
- keyword.add("right");
- keyword.add("of");
- keyword.add("on");
- keyword.add("link");
- 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");
- keyword.add("elseif");
- keyword.add("endif");
- keyword.add("partition");
- keyword.add("footer");
- keyword.add("header");
- keyword.add("center");
- keyword.add("rotate");
- keyword.add("ref");
- 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");
- keyword.add("kill");
-
- preproc.add("!include");
- preproc.add("!define");
- preproc.add("!undef");
- preproc.add("!ifdef");
- preproc.add("!endif");
- preproc.add("!ifndef");
- }
-
- public void print(PrintStream ps) {
- print(ps, "type", type);
- print(ps, "keyword", keyword);
- print(ps, "preprocessor", preproc);
- print(ps, "skinparameter", SkinParam.getPossibleValues());
- print(ps, "color", new HtmlColorSetSimple().names());
- 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();
- }
-
-}
+/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2017, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * 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 + * + * 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 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * 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 + * + * + */ +package net.sourceforge.plantuml.syntax; + +import java.io.PrintStream; +import java.util.Collection; +import java.util.Set; +import java.util.TreeSet; + +import net.sourceforge.plantuml.SkinParam; +import net.sourceforge.plantuml.graphic.HtmlColorSetSimple; + +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() { + + 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"); + type.add("artifact"); + type.add("folder"); + type.add("rectangle"); + type.add("node"); + type.add("frame"); + type.add("cloud"); + type.add("database"); + type.add("storage"); + type.add("agent"); + type.add("stack"); + type.add("boundary"); + type.add("control"); + type.add("entity"); + type.add("card"); + type.add("file"); + type.add("package"); + type.add("queue"); + type.add("archimate"); + + keyword.add("@startuml"); + keyword.add("@enduml"); + keyword.add("@startdot"); + keyword.add("@enddot"); + keyword.add("@startsalt"); + keyword.add("@endsalt"); + keyword.add("as"); + keyword.add("also"); + keyword.add("autonumber"); + keyword.add("caption"); + 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"); + keyword.add("rnote"); + keyword.add("hnote"); + keyword.add("legend"); + keyword.add("group"); + keyword.add("left"); + keyword.add("right"); + keyword.add("of"); + keyword.add("on"); + keyword.add("link"); + 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"); + keyword.add("elseif"); + keyword.add("endif"); + keyword.add("partition"); + keyword.add("footer"); + keyword.add("header"); + keyword.add("center"); + keyword.add("rotate"); + keyword.add("ref"); + 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"); + keyword.add("kill"); + + preproc.add("!include"); + preproc.add("!pragma"); + preproc.add("!define"); + preproc.add("!undef"); + preproc.add("!if"); + preproc.add("!ifdef"); + preproc.add("!endif"); + preproc.add("!ifndef"); + preproc.add("!else"); + preproc.add("!definelong"); + preproc.add("!enddefinelong"); + } + + public void print(PrintStream ps) { + print(ps, "type", type); + print(ps, "keyword", keyword); + print(ps, "preprocessor", preproc); + print(ps, "skinparameter", SkinParam.getPossibleValues()); + print(ps, "color", new HtmlColorSetSimple().names()); + 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(); + } + +} |