├── class ├── README.md ├── .otl.sh.swp ├── Main.class ├── loop │ ├── If.class │ ├── For.class │ ├── Loop.class │ └── Bracket.class ├── etc │ ├── TryCatch.class │ └── TryCatchPrint.class ├── extend │ ├── Class.class │ └── ClassWork.class ├── item │ ├── Setting.class │ ├── VarCheck.class │ ├── work │ │ ├── Check.class │ │ ├── LoopWork.class │ │ ├── PrintWork.class │ │ ├── VariableWork.class │ │ └── ComparisonWork.class │ ├── ActivityItem.class │ ├── KeyValueItem.class │ ├── LoopPosition.class │ ├── ReservedWord.class │ └── kind │ │ ├── VarType.class │ │ └── LoopType.class ├── math │ ├── PRandom.class │ └── MathWork.class ├── print │ ├── Print.class │ ├── Println.class │ └── ScannerP.class ├── Variable │ ├── FloatP.class │ ├── LongP.class │ ├── BooleanP.class │ ├── DoubleP.class │ ├── IntegerP.class │ ├── StringP.class │ ├── Variable.class │ ├── CharacterP.class │ └── SetVariable.class ├── Calculation │ ├── Account.class │ └── Calculation.class └── comparison │ ├── Comparison.class │ ├── ComparisonBool.class │ └── StringComparison.class ├── .gitignore ├── settings.gradle ├── src └── main │ └── java │ ├── etc │ ├── reader │ │ ├── controller │ │ │ ├── Class.java │ │ │ └── FileRead.java │ │ ├── define │ │ │ ├── ClassWork.java │ │ │ └── FileWork.java │ │ ├── infor │ │ │ ├── otl │ │ │ │ ├── otl.json │ │ │ │ ├── console.json │ │ │ │ └── sing.json │ │ │ └── poison │ │ │ │ └── html.json │ │ ├── RunOTL.java │ │ └── ReadJSON.java │ ├── Poison.json │ └── OTLanguage.json │ ├── http │ ├── define │ │ └── HttpMethodType.java │ ├── model │ │ ├── HttpWork.java │ │ ├── HttpMoveWork.java │ │ └── HttpCreateWork.java │ ├── controller │ │ ├── db │ │ │ ├── define │ │ │ │ ├── DataBaseWork.java │ │ │ │ ├── SelectWork.java │ │ │ │ └── DBType.java │ │ │ ├── controller │ │ │ │ ├── sql │ │ │ │ │ ├── DCL.java │ │ │ │ │ ├── DDL.java │ │ │ │ │ └── DML.java │ │ │ │ ├── DatabaseCheck.java │ │ │ │ └── pattern │ │ │ │ │ ├── DataBaseShell.java │ │ │ │ │ ├── DataBaseShellPattern1.java │ │ │ │ │ └── DataBaseShellPattern2.java │ │ │ └── DatabaseSetting.java │ │ ├── create │ │ │ └── CreateHTML.java │ │ ├── move │ │ │ ├── MoveGetHttp.java │ │ │ └── MovePostHttp.java │ │ ├── StartServer.java │ │ ├── PortVariable.java │ │ ├── HTMLVariable.java │ │ └── HttpGetPost.java │ ├── handler │ │ ├── HandlerDao.java │ │ ├── HttpGetHandler.java │ │ ├── HttpPostHandler.java │ │ └── UriParser.java │ ├── server │ │ ├── Server.java │ │ ├── HttpServerManager.java │ │ ├── CreateHTML.java │ │ └── RootHandler.java │ └── items │ │ ├── HttpRepository.java │ │ └── Color.java │ ├── input │ └── conroller │ │ ├── MouseController.java │ │ ├── mouse │ │ ├── define │ │ │ └── MousePositionWork.java │ │ └── controller │ │ │ ├── MousePositionY.java │ │ │ ├── MousePositionXY.java │ │ │ └── MousePositionX.java │ │ ├── Mouse.java │ │ ├── KeyboardController.java │ │ └── KeyboardRepository.java │ ├── origin │ ├── variable │ │ ├── define │ │ │ ├── VariableKind.java │ │ │ └── VariableType.java │ │ ├── model │ │ │ ├── VariableListWork.java │ │ │ ├── VariableWork.java │ │ │ └── Repository.java │ │ └── controller │ │ │ ├── list │ │ │ └── ListVariable.java │ │ │ ├── MakeArrayVariable.java │ │ │ ├── GetVariable.java │ │ │ ├── MakeListVariable.java │ │ │ ├── MakeVariable.java │ │ │ └── SetVariable.java │ ├── exception │ │ ├── IndexMessage.java │ │ ├── ServerMessage.java │ │ ├── RandomMessage.java │ │ ├── DBMessage.java │ │ ├── MatchMessage.java │ │ ├── FileFailMessage.java │ │ ├── DBException.java │ │ ├── IndexException.java │ │ ├── MatchException.java │ │ ├── RandomException.java │ │ ├── ServerException.java │ │ ├── FileFailException.java │ │ ├── VariableException.java │ │ └── VariableMessage.java │ ├── consol │ │ ├── define │ │ │ ├── PrintWork.java │ │ │ └── PriorityPrintWork.java │ │ └── controller │ │ │ ├── ConsoleScanner.java │ │ │ ├── Println.java │ │ │ ├── PriorityPrint.java │ │ │ ├── PriorityPrintln.java │ │ │ └── Print.java │ ├── thead │ │ ├── model │ │ │ └── ThreadWork.java │ │ └── controller │ │ │ └── Sleep.java │ └── loop │ │ ├── model │ │ └── LoopWork.java │ │ ├── controller │ │ ├── If.java │ │ ├── NewForEach.java │ │ ├── For.java │ │ └── ForEach.java │ │ └── define │ │ └── Bracket.java │ ├── method │ ├── define │ │ └── MethodWork.java │ └── controller │ │ └── Method.java │ ├── system │ ├── work │ │ ├── FinishWork.java │ │ ├── SystemWork.java │ │ └── ThreadWork.java │ └── start │ │ ├── Finish.java │ │ ├── OSSetting.java │ │ ├── keyword │ │ ├── SpecialKeyword.java │ │ └── KeyWordRepository.java │ │ └── exception │ │ ├── Sleep.java │ │ └── TryCatch.java │ ├── math │ ├── model │ │ ├── RandomWork.java │ │ └── CalculationWork.java │ └── controller │ │ ├── random │ │ ├── RandomBoolean.java │ │ ├── RandomLong.java │ │ ├── RandomFloat.java │ │ ├── RandomDouble.java │ │ └── RandomInteger.java │ │ ├── StringCalculation.java │ │ ├── NumberCalculation.java │ │ └── Calculation.java │ ├── custom │ ├── registration │ │ ├── define │ │ │ └── RepositoryValue.java │ │ └── controller │ │ │ ├── DefineCustomClass.java │ │ │ └── DefineMainMethod.java │ ├── tool │ │ ├── CustomSetVariable.java │ │ └── CustomGetVariable.java │ └── use │ │ └── controller │ │ ├── UseCustomVoid.java │ │ ├── UseCustomClass.java │ │ └── UseCustomString.java │ ├── pattern │ ├── MakePatternWork.java │ └── MakePattern.java │ ├── event │ ├── db │ │ ├── DBRepository.java │ │ └── DBSetting.java │ ├── Controller.java │ └── list │ │ └── ListSetting.java │ └── Main.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── out └── production │ └── classes │ ├── Main.class │ ├── event │ ├── Setting.class │ ├── Controller.class │ └── list │ │ ├── ListSetting.class │ │ ├── ListSetting$1.class │ │ ├── ListSetting$2.class │ │ └── ListSetting$3.class │ ├── etc │ └── reader │ │ ├── RunOTL.class │ │ └── ReadJSON.class │ ├── http │ ├── items │ │ ├── Color.class │ │ └── HttpRepository.class │ ├── server │ │ ├── Server.class │ │ ├── CreateHTML.class │ │ ├── RootHandler.class │ │ └── HttpServerManager.class │ ├── model │ │ ├── HttpWork.class │ │ ├── HttpMoveWork.class │ │ └── HttpCreateWork.class │ ├── handler │ │ ├── UriParser.class │ │ ├── HttpGetHandler.class │ │ └── HttpPostHandler.class │ ├── controller │ │ ├── HTMLVariable.class │ │ ├── HttpGetPost.class │ │ ├── PortVariable.class │ │ ├── StartServer.class │ │ ├── create │ │ │ └── CreateHTML.class │ │ ├── db │ │ │ ├── SQLiteSetting.class │ │ │ └── DatabaseSetting.class │ │ └── move │ │ │ ├── MoveGetHttp.class │ │ │ └── MovePostHttp.class │ └── define │ │ └── HttpMethodType.class │ ├── pattern │ ├── MakePattern.class │ └── MakePatternWork.class │ ├── math │ ├── model │ │ ├── RandomWork.class │ │ └── CalculationWork.class │ └── controller │ │ ├── Calculation.class │ │ ├── BoolCalculation.class │ │ ├── NumberCalculation.class │ │ ├── StringCalculation.class │ │ └── random │ │ ├── RandomLong.class │ │ ├── RandomDouble.class │ │ ├── RandomFloat.class │ │ ├── RandomBoolean.class │ │ └── RandomInteger.class │ └── origin │ ├── loop │ ├── controller │ │ ├── If.class │ │ └── For.class │ ├── define │ │ └── Bracket.class │ └── model │ │ └── LoopWork.class │ ├── exception │ ├── DBException.class │ ├── DBMessage.class │ ├── MatchMessage.class │ ├── RandomMessage.class │ ├── ServerMessage.class │ ├── FileFailMessage.class │ ├── MatchException.class │ ├── RandomException.class │ ├── ServerException.class │ ├── VariableMessage.class │ ├── FileFailException.class │ └── VariableException.class │ ├── consol │ ├── controller │ │ ├── Print.class │ │ ├── Println.class │ │ ├── PriorityPrint.class │ │ ├── ConsoleScanner.class │ │ └── PriorityPrintln.class │ └── define │ │ ├── PrintWork.class │ │ └── PriorityPrintWork.class │ ├── thead │ ├── controller │ │ └── Sleep.class │ └── model │ │ └── ThreadWork.class │ └── variable │ ├── model │ ├── Repository.class │ ├── VariableWork.class │ └── VariableListWork.class │ ├── define │ ├── VariableType.class │ └── VariableCheck.class │ └── controller │ ├── GetVariable.class │ ├── SetVariable.class │ ├── MakeVariable.class │ ├── MakeListVariable.class │ ├── MakeArrayVariable.class │ └── list │ └── ListVariable.class ├── sub.html ├── .idea ├── vcs.xml ├── .gitignore ├── misc.xml ├── compiler.xml ├── gradle.xml └── jarRepositories.xml ├── README.md ├── index.html └── gradlew.bat /class/README.md: -------------------------------------------------------------------------------- 1 | 클래스 생성 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /.gradle/ -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'OTLanguage-Shell' 2 | 3 | -------------------------------------------------------------------------------- /class/.otl.sh.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/.otl.sh.swp -------------------------------------------------------------------------------- /class/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Main.class -------------------------------------------------------------------------------- /class/loop/If.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/loop/If.class -------------------------------------------------------------------------------- /class/loop/For.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/loop/For.class -------------------------------------------------------------------------------- /class/loop/Loop.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/loop/Loop.class -------------------------------------------------------------------------------- /class/etc/TryCatch.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/etc/TryCatch.class -------------------------------------------------------------------------------- /class/extend/Class.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/extend/Class.class -------------------------------------------------------------------------------- /class/item/Setting.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/Setting.class -------------------------------------------------------------------------------- /class/loop/Bracket.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/loop/Bracket.class -------------------------------------------------------------------------------- /class/math/PRandom.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/math/PRandom.class -------------------------------------------------------------------------------- /class/print/Print.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/print/Print.class -------------------------------------------------------------------------------- /class/Variable/FloatP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/FloatP.class -------------------------------------------------------------------------------- /class/Variable/LongP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/LongP.class -------------------------------------------------------------------------------- /class/item/VarCheck.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/VarCheck.class -------------------------------------------------------------------------------- /class/item/work/Check.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/work/Check.class -------------------------------------------------------------------------------- /class/math/MathWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/math/MathWork.class -------------------------------------------------------------------------------- /class/print/Println.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/print/Println.class -------------------------------------------------------------------------------- /class/print/ScannerP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/print/ScannerP.class -------------------------------------------------------------------------------- /class/Variable/BooleanP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/BooleanP.class -------------------------------------------------------------------------------- /class/Variable/DoubleP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/DoubleP.class -------------------------------------------------------------------------------- /class/Variable/IntegerP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/IntegerP.class -------------------------------------------------------------------------------- /class/Variable/StringP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/StringP.class -------------------------------------------------------------------------------- /class/Variable/Variable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/Variable.class -------------------------------------------------------------------------------- /class/etc/TryCatchPrint.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/etc/TryCatchPrint.class -------------------------------------------------------------------------------- /class/extend/ClassWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/extend/ClassWork.class -------------------------------------------------------------------------------- /class/item/ActivityItem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/ActivityItem.class -------------------------------------------------------------------------------- /class/item/KeyValueItem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/KeyValueItem.class -------------------------------------------------------------------------------- /class/item/LoopPosition.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/LoopPosition.class -------------------------------------------------------------------------------- /class/item/ReservedWord.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/ReservedWord.class -------------------------------------------------------------------------------- /class/item/kind/VarType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/kind/VarType.class -------------------------------------------------------------------------------- /src/main/java/etc/reader/controller/Class.java: -------------------------------------------------------------------------------- 1 | package etc.reader.controller; 2 | 3 | public class Class { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /class/Calculation/Account.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Calculation/Account.class -------------------------------------------------------------------------------- /class/Variable/CharacterP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/CharacterP.class -------------------------------------------------------------------------------- /class/Variable/SetVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Variable/SetVariable.class -------------------------------------------------------------------------------- /class/item/kind/LoopType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/kind/LoopType.class -------------------------------------------------------------------------------- /class/item/work/LoopWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/work/LoopWork.class -------------------------------------------------------------------------------- /class/item/work/PrintWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/work/PrintWork.class -------------------------------------------------------------------------------- /class/comparison/Comparison.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/comparison/Comparison.class -------------------------------------------------------------------------------- /class/item/work/VariableWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/work/VariableWork.class -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /out/production/classes/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/Main.class -------------------------------------------------------------------------------- /src/main/java/http/define/HttpMethodType.java: -------------------------------------------------------------------------------- 1 | package http.define; 2 | 3 | public enum HttpMethodType { 4 | POST, GET 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/input/conroller/MouseController.java: -------------------------------------------------------------------------------- 1 | package input.conroller; 2 | 3 | public class MouseController { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /class/Calculation/Calculation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/Calculation/Calculation.class -------------------------------------------------------------------------------- /class/comparison/ComparisonBool.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/comparison/ComparisonBool.class -------------------------------------------------------------------------------- /class/item/work/ComparisonWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/item/work/ComparisonWork.class -------------------------------------------------------------------------------- /class/comparison/StringComparison.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/class/comparison/StringComparison.class -------------------------------------------------------------------------------- /out/production/classes/event/Setting.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/event/Setting.class -------------------------------------------------------------------------------- /src/main/java/origin/variable/define/VariableKind.java: -------------------------------------------------------------------------------- 1 | package origin.variable.define; 2 | 3 | public enum VariableKind { 4 | ORIGIN, LIST 5 | } 6 | -------------------------------------------------------------------------------- /out/production/classes/etc/reader/RunOTL.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/etc/reader/RunOTL.class -------------------------------------------------------------------------------- /out/production/classes/event/Controller.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/event/Controller.class -------------------------------------------------------------------------------- /out/production/classes/http/items/Color.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/items/Color.class -------------------------------------------------------------------------------- /out/production/classes/http/server/Server.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/server/Server.class -------------------------------------------------------------------------------- /src/main/java/etc/reader/define/ClassWork.java: -------------------------------------------------------------------------------- 1 | package etc.reader.define; 2 | 3 | public interface ClassWork { 4 | boolean check(String line); 5 | } 6 | -------------------------------------------------------------------------------- /out/production/classes/etc/reader/ReadJSON.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/etc/reader/ReadJSON.class -------------------------------------------------------------------------------- /out/production/classes/http/model/HttpWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/model/HttpWork.class -------------------------------------------------------------------------------- /out/production/classes/pattern/MakePattern.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/pattern/MakePattern.class -------------------------------------------------------------------------------- /out/production/classes/event/list/ListSetting.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/event/list/ListSetting.class -------------------------------------------------------------------------------- /out/production/classes/http/handler/UriParser.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/handler/UriParser.class -------------------------------------------------------------------------------- /out/production/classes/http/model/HttpMoveWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/model/HttpMoveWork.class -------------------------------------------------------------------------------- /out/production/classes/http/server/CreateHTML.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/server/CreateHTML.class -------------------------------------------------------------------------------- /out/production/classes/http/server/RootHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/server/RootHandler.class -------------------------------------------------------------------------------- /out/production/classes/math/model/RandomWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/model/RandomWork.class -------------------------------------------------------------------------------- /out/production/classes/pattern/MakePatternWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/pattern/MakePatternWork.class -------------------------------------------------------------------------------- /out/production/classes/event/list/ListSetting$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/event/list/ListSetting$1.class -------------------------------------------------------------------------------- /out/production/classes/event/list/ListSetting$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/event/list/ListSetting$2.class -------------------------------------------------------------------------------- /out/production/classes/event/list/ListSetting$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/event/list/ListSetting$3.class -------------------------------------------------------------------------------- /out/production/classes/http/items/HttpRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/items/HttpRepository.class -------------------------------------------------------------------------------- /out/production/classes/http/model/HttpCreateWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/model/HttpCreateWork.class -------------------------------------------------------------------------------- /out/production/classes/origin/loop/controller/If.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/loop/controller/If.class -------------------------------------------------------------------------------- /src/main/java/method/define/MethodWork.java: -------------------------------------------------------------------------------- 1 | package method.define; 2 | 3 | public interface MethodWork { 4 | boolean check(String line); 5 | void start(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/IndexMessage.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public interface IndexMessage { 4 | String removeError = "삭제 할 수 없는 값입니다."; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/ServerMessage.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public interface ServerMessage { 4 | String nullServer = "서버를 먼저 실행해주세요."; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/system/work/FinishWork.java: -------------------------------------------------------------------------------- 1 | package system.work; 2 | 3 | public interface FinishWork { 4 | boolean check(String line); 5 | void start(); 6 | } 7 | -------------------------------------------------------------------------------- /out/production/classes/http/controller/HTMLVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/HTMLVariable.class -------------------------------------------------------------------------------- /out/production/classes/http/controller/HttpGetPost.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/HttpGetPost.class -------------------------------------------------------------------------------- /out/production/classes/http/controller/PortVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/PortVariable.class -------------------------------------------------------------------------------- /out/production/classes/http/controller/StartServer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/StartServer.class -------------------------------------------------------------------------------- /out/production/classes/http/define/HttpMethodType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/define/HttpMethodType.class -------------------------------------------------------------------------------- /out/production/classes/http/handler/HttpGetHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/handler/HttpGetHandler.class -------------------------------------------------------------------------------- /out/production/classes/http/handler/HttpPostHandler.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/handler/HttpPostHandler.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/Calculation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/Calculation.class -------------------------------------------------------------------------------- /out/production/classes/math/model/CalculationWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/model/CalculationWork.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/DBException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/DBException.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/DBMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/DBMessage.class -------------------------------------------------------------------------------- /out/production/classes/origin/loop/controller/For.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/loop/controller/For.class -------------------------------------------------------------------------------- /out/production/classes/origin/loop/define/Bracket.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/loop/define/Bracket.class -------------------------------------------------------------------------------- /out/production/classes/origin/loop/model/LoopWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/loop/model/LoopWork.class -------------------------------------------------------------------------------- /src/main/java/http/model/HttpWork.java: -------------------------------------------------------------------------------- 1 | package http.model; 2 | 3 | public interface HttpWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/RandomMessage.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public interface RandomMessage { 4 | String randomSame = "같은 값을 사용할 수 없습니다."; 5 | } 6 | -------------------------------------------------------------------------------- /out/production/classes/http/server/HttpServerManager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/server/HttpServerManager.class -------------------------------------------------------------------------------- /out/production/classes/origin/consol/controller/Print.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/consol/controller/Print.class -------------------------------------------------------------------------------- /out/production/classes/origin/consol/define/PrintWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/consol/define/PrintWork.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/MatchMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/MatchMessage.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/RandomMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/RandomMessage.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/ServerMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/ServerMessage.class -------------------------------------------------------------------------------- /out/production/classes/origin/thead/controller/Sleep.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/thead/controller/Sleep.class -------------------------------------------------------------------------------- /out/production/classes/origin/thead/model/ThreadWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/thead/model/ThreadWork.class -------------------------------------------------------------------------------- /src/main/java/http/model/HttpMoveWork.java: -------------------------------------------------------------------------------- 1 | package http.model; 2 | 3 | public interface HttpMoveWork { 4 | boolean check(String line); 5 | void move(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/math/model/RandomWork.java: -------------------------------------------------------------------------------- 1 | package math.model; 2 | 3 | public interface RandomWork { 4 | boolean check(String line); 5 | String start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/system/work/SystemWork.java: -------------------------------------------------------------------------------- 1 | package system.work; 2 | 3 | public interface SystemWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/system/work/ThreadWork.java: -------------------------------------------------------------------------------- 1 | package system.work; 2 | 3 | public interface ThreadWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /out/production/classes/http/controller/create/CreateHTML.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/create/CreateHTML.class -------------------------------------------------------------------------------- /out/production/classes/http/controller/db/SQLiteSetting.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/db/SQLiteSetting.class -------------------------------------------------------------------------------- /out/production/classes/http/controller/move/MoveGetHttp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/move/MoveGetHttp.class -------------------------------------------------------------------------------- /out/production/classes/http/controller/move/MovePostHttp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/move/MovePostHttp.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/BoolCalculation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/BoolCalculation.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/NumberCalculation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/NumberCalculation.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/StringCalculation.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/StringCalculation.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/random/RandomLong.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/random/RandomLong.class -------------------------------------------------------------------------------- /out/production/classes/origin/consol/controller/Println.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/consol/controller/Println.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/FileFailMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/FileFailMessage.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/MatchException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/MatchException.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/RandomException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/RandomException.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/ServerException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/ServerException.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/VariableMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/VariableMessage.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/model/Repository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/model/Repository.class -------------------------------------------------------------------------------- /src/main/java/etc/reader/define/FileWork.java: -------------------------------------------------------------------------------- 1 | package etc.reader.define; 2 | 3 | public interface FileWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/http/model/HttpCreateWork.java: -------------------------------------------------------------------------------- 1 | package http.model; 2 | 3 | public interface HttpCreateWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /out/production/classes/http/controller/db/DatabaseSetting.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/http/controller/db/DatabaseSetting.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/random/RandomDouble.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/random/RandomDouble.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/random/RandomFloat.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/random/RandomFloat.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/FileFailException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/FileFailException.class -------------------------------------------------------------------------------- /out/production/classes/origin/exception/VariableException.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/exception/VariableException.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/define/VariableType.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/define/VariableType.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/model/VariableWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/model/VariableWork.class -------------------------------------------------------------------------------- /src/main/java/math/model/CalculationWork.java: -------------------------------------------------------------------------------- 1 | package math.model; 2 | 3 | public interface CalculationWork { 4 | boolean check(String line); 5 | String start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /out/production/classes/math/controller/random/RandomBoolean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/random/RandomBoolean.class -------------------------------------------------------------------------------- /out/production/classes/math/controller/random/RandomInteger.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/math/controller/random/RandomInteger.class -------------------------------------------------------------------------------- /out/production/classes/origin/consol/controller/PriorityPrint.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/consol/controller/PriorityPrint.class -------------------------------------------------------------------------------- /out/production/classes/origin/consol/define/PriorityPrintWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/consol/define/PriorityPrintWork.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/controller/GetVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/controller/GetVariable.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/controller/SetVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/controller/SetVariable.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/define/VariableCheck.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/define/VariableCheck.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/model/VariableListWork.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/model/VariableListWork.class -------------------------------------------------------------------------------- /src/main/java/origin/consol/define/PrintWork.java: -------------------------------------------------------------------------------- 1 | package origin.consol.define; 2 | 3 | public interface PrintWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/origin/thead/model/ThreadWork.java: -------------------------------------------------------------------------------- 1 | package origin.thead.model; 2 | 3 | public interface ThreadWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/define/VariableType.java: -------------------------------------------------------------------------------- 1 | package origin.variable.define; 2 | 3 | public enum VariableType { 4 | Boolean, Character, Double, Float, Integer, Long, String 5 | } 6 | -------------------------------------------------------------------------------- /out/production/classes/origin/consol/controller/ConsoleScanner.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/consol/controller/ConsoleScanner.class -------------------------------------------------------------------------------- /out/production/classes/origin/consol/controller/PriorityPrintln.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/consol/controller/PriorityPrintln.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/controller/MakeVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/controller/MakeVariable.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/controller/MakeListVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/controller/MakeListVariable.class -------------------------------------------------------------------------------- /sub.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

서브페이지에 오신걸 환영합니다.

9 | 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /out/production/classes/origin/variable/controller/MakeArrayVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/controller/MakeArrayVariable.class -------------------------------------------------------------------------------- /out/production/classes/origin/variable/controller/list/ListVariable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PersesTitan/OTLanguage-Shell/HEAD/out/production/classes/origin/variable/controller/list/ListVariable.class -------------------------------------------------------------------------------- /src/main/java/http/controller/db/define/DataBaseWork.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.define; 2 | 3 | public interface DataBaseWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/define/SelectWork.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.define; 2 | 3 | public interface SelectWork { 4 | boolean check(String line); 5 | String start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/origin/consol/define/PriorityPrintWork.java: -------------------------------------------------------------------------------- 1 | package origin.consol.define; 2 | 3 | public interface PriorityPrintWork { 4 | boolean check(String line); 5 | void start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/model/VariableListWork.java: -------------------------------------------------------------------------------- 1 | package origin.variable.model; 2 | 3 | public interface VariableListWork { 4 | boolean check(String line); 5 | String start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/custom/registration/define/RepositoryValue.java: -------------------------------------------------------------------------------- 1 | package custom.registration.define; 2 | 3 | import java.util.List; 4 | 5 | public record RepositoryValue(List varType, List values) { } 6 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /src/main/java/input/conroller/mouse/define/MousePositionWork.java: -------------------------------------------------------------------------------- 1 | package input.conroller.mouse.define; 2 | 3 | public interface MousePositionWork { 4 | boolean check(String line); 5 | String start(String line); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/DBMessage.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public interface DBMessage { 4 | String error = "디비생성에 실패하였습니다."; 5 | String noDataBase = "데이터베이스가 존재하지 않습니다. 데이터베이스를 먼저 생성해주세요."; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/etc/Poison.json: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "1.0.0", 3 | "founder" : "PersesTitan", 4 | "link" : "https://gthub.com/OTLanguage", 5 | "kind" : "Web Framework", 6 | "help" : [ 7 | "<ㅇㅅㅇ> [변수명]:[초기값] = 웹 변수 등록" 8 | ] 9 | } -------------------------------------------------------------------------------- /src/main/java/http/handler/HandlerDao.java: -------------------------------------------------------------------------------- 1 | package http.handler; 2 | 3 | import http.define.HttpMethodType; 4 | 5 | import java.util.Map; 6 | 7 | public record HandlerDao(String value, String path, Map parameters) { 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/pattern/MakePatternWork.java: -------------------------------------------------------------------------------- 1 | package pattern; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | public interface MakePatternWork { 6 | boolean check(String line); 7 | Pattern getPattern(); 8 | void start(String line); 9 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/MatchMessage.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public interface MatchMessage { 4 | String matchError = "괄호의 짝이 맞지 않습니다."; 5 | String boolError = "ㅇㅇ ㄴㄴ 문법이 오류가 발생하였습니다."; 6 | String grammarError = "문법 오류가 발생하였습니다."; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/FileFailMessage.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public interface FileFailMessage { 4 | String doNotFindFile = "파일을 찾을 수 없습니다."; 5 | String doNotReadFile = "파일을 읽을 수 없습니다."; 6 | String notMatchExtension = "읽을 수 없는 확장자 입니다."; 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/model/VariableWork.java: -------------------------------------------------------------------------------- 1 | package origin.variable.model; 2 | 3 | import java.util.Map; 4 | import java.util.Set; 5 | 6 | public interface VariableWork { 7 | boolean check(String line); 8 | void start(String line, 9 | Map> repository, 10 | Set set); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/define/DBType.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.define; 2 | 3 | public class DBType { 4 | public enum DDL { 5 | CREATE, ALTER, DROP 6 | } 7 | 8 | public enum DCL { 9 | GRANT, REVOKE, COMMIT, ROLLBACK 10 | } 11 | 12 | public enum DML { 13 | SELECT, INSERT, UPDATE, DELETE 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/event/db/DBRepository.java: -------------------------------------------------------------------------------- 1 | package event.db; 2 | 3 | import http.controller.db.define.DataBaseWork; 4 | import http.controller.db.define.SelectWork; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public interface DBRepository { 10 | List dbWorks = new ArrayList<>(); 11 | List selectWorks = new ArrayList<>(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/etc/reader/infor/otl/otl.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "", 4 | "rescue": "", 5 | "grammar": "", 6 | "version": "", 7 | "explanation": "", 8 | "example": "", 9 | "print": "" 10 | }, 11 | { 12 | "name": "", 13 | "rescue": "", 14 | "grammar": "", 15 | "version": "", 16 | "explanation": "", 17 | "example": "", 18 | "print": "" 19 | } 20 | ] -------------------------------------------------------------------------------- /src/main/java/origin/exception/DBException.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public class DBException extends RuntimeException { 4 | public DBException() { 5 | super(); 6 | } 7 | 8 | public DBException(String message) { 9 | super(message); 10 | } 11 | 12 | public DBException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OTLanguage-Shell 2 | 다들 시간나실때 심심풀이로 한번 해보시는 건 어떤가요?? 3 | ### 다운로드 (download) 4 | ``` 5 | curl https://raw.githubusercontent.com/OTLanguage/.github/main/otlmake.sh | sh 6 | ``` 7 | 8 | ### 링크 (link) 9 | 10 | - [Github](https://github.com/OTLanguage) 11 | - [Velog](https://velog.io/@persestitan/series/OTLanguage) 12 | 13 | --- 14 | 15 | ### 문법 16 | 17 | #### 변수 18 | - ㅇㅈㅇ [변수명]:[초기값] 19 | - ㅇㅉㅇ 20 | - ㅇㅂㅇ 21 | -------------------------------------------------------------------------------- /src/main/java/method/controller/Method.java: -------------------------------------------------------------------------------- 1 | package method.controller; 2 | 3 | import method.define.MethodWork; 4 | 5 | import java.util.regex.Pattern; 6 | 7 | public record Method(Pattern pattern) implements MethodWork { 8 | 9 | @Override 10 | public boolean check(String line) { 11 | return pattern.matcher(line).find(); 12 | } 13 | 14 | @Override 15 | public void start() { 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/etc/reader/RunOTL.java: -------------------------------------------------------------------------------- 1 | package etc.reader; 2 | 3 | import event.Setting; 4 | import origin.exception.FileFailException; 5 | import origin.exception.FileFailMessage; 6 | 7 | import java.io.File; 8 | 9 | public class RunOTL extends Setting { 10 | 11 | public void startOTL(String path) { 12 | if (!new File(path).canRead()) throw new FileFailException(FileFailMessage.doNotReadFile); 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/controller/sql/DCL.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.controller.sql; 2 | 3 | import http.items.Color; 4 | 5 | import java.sql.Connection; 6 | import java.sql.SQLException; 7 | 8 | public class DCL { 9 | 10 | public void commit(Connection con) throws SQLException { 11 | con.commit(); 12 | } 13 | 14 | public void rollback(Connection con) throws SQLException { 15 | con.rollback(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/IndexException.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public class IndexException extends RuntimeException { 4 | public IndexException() { 5 | super(); 6 | } 7 | 8 | public IndexException(String message) { 9 | super(message); 10 | } 11 | 12 | public IndexException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | public IndexException(Throwable cause) { 17 | super(cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/MatchException.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public class MatchException extends RuntimeException { 4 | 5 | public MatchException() { 6 | super(); 7 | } 8 | 9 | public MatchException(String message) { 10 | super(message); 11 | } 12 | 13 | public MatchException(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | public MatchException(Throwable cause) { 18 | super(cause); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/RandomException.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public class RandomException extends RuntimeException { 4 | public RandomException() { 5 | super(); 6 | } 7 | 8 | public RandomException(String message) { 9 | super(message); 10 | } 11 | 12 | public RandomException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | public RandomException(Throwable cause) { 17 | super(cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/ServerException.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public class ServerException extends RuntimeException { 4 | public ServerException() { 5 | super(); 6 | } 7 | 8 | public ServerException(String message) { 9 | super(message); 10 | } 11 | 12 | public ServerException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | public ServerException(Throwable cause) { 17 | super(cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/FileFailException.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public class FileFailException extends RuntimeException { 4 | public FileFailException() { 5 | super(); 6 | } 7 | 8 | public FileFailException(String message) { 9 | super(message); 10 | } 11 | 12 | public FileFailException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | public FileFailException(Throwable cause) { 17 | super(cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/VariableException.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public class VariableException extends RuntimeException { 4 | 5 | public VariableException() { 6 | super(); 7 | } 8 | 9 | public VariableException(String message) { 10 | super(message); 11 | } 12 | 13 | public VariableException(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | public VariableException(Throwable cause) { 18 | super(cause); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/system/start/Finish.java: -------------------------------------------------------------------------------- 1 | package system.start; 2 | 3 | import system.work.FinishWork; 4 | 5 | import java.util.regex.Pattern; 6 | 7 | public class Finish implements FinishWork { 8 | private final Pattern pattern; 9 | 10 | public Finish(String patternText) { 11 | this.pattern = Pattern.compile("^\\s*" + patternText); 12 | } 13 | 14 | @Override 15 | public boolean check(String line) { 16 | return pattern.matcher(line).find(); 17 | } 18 | 19 | @Override 20 | public void start() { 21 | System.exit(0); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/etc/reader/infor/poison/html.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "웹 변수", 4 | "rescue": "<ㅇㅅㅇ>", 5 | "grammar": "<ㅇㅅㅇ> [변수명]:[초기값]", 6 | "version": "2.1.0", 7 | "explanation": "HTML 변수를 정의합니다.", 8 | "example": "<ㅇㅅㅇ> 변수:안녕하세요.
(HTML) <p>{{ :변수 }}</p>", 9 | "print": "안녕하세요." 10 | }, 11 | { 12 | "name": "HTML 등록", 13 | "rescue": "[경로] <ㅇㅅㅇ< [HTML파일 경로]", 14 | "grammar": "<ㅇㅅㅇ<", 15 | "version": "2.1.0", 16 | "explanation": "HTML파일을 등록하는 합니다.", 17 | "example": "/ <ㅇㅅㅇ< index.html", 18 | "print": "" 19 | } 20 | ] -------------------------------------------------------------------------------- /src/main/java/origin/variable/controller/list/ListVariable.java: -------------------------------------------------------------------------------- 1 | package origin.variable.controller.list; 2 | 3 | import origin.variable.model.VariableListWork; 4 | 5 | import java.util.regex.Pattern; 6 | 7 | public abstract class ListVariable implements VariableListWork { 8 | private final Pattern pattern; 9 | 10 | public ListVariable(Pattern pattern) { 11 | this.pattern = pattern; 12 | } 13 | 14 | @Override 15 | public boolean check(String line) { 16 | return pattern.matcher(line).find(); 17 | } 18 | 19 | public abstract String start(String line); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/system/start/OSSetting.java: -------------------------------------------------------------------------------- 1 | package system.start; 2 | 3 | import java.util.Arrays; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import java.util.Objects; 7 | 8 | public class OSSetting { 9 | public static void main(String[] args) { 10 | Map map = new HashMap<>(); 11 | map.put("key", "a"); 12 | System.out.println(map); 13 | System.out.println(Arrays.toString("클래스명~".split("~"))); 14 | } 15 | 16 | // 슬래쉬 반환 17 | public static String sep() { 18 | return System.getProperty("file.separator"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | -------------------------------------------------------------------------------- /src/main/java/origin/exception/VariableMessage.java: -------------------------------------------------------------------------------- 1 | package origin.exception; 2 | 3 | public interface VariableMessage { 4 | String typeMatchError = "변수 타입이 일치하지 않습니다."; 5 | String sameVariable = "은(는) 이미 존재하는 변수명 입니다."; 6 | String sameMethod = "은(는) 이미 존재하는 클래스명/메소드명 입니다."; 7 | String doNotFindClass = "은(는) 존재하지않는 클래스명 입니다."; 8 | String doNotFindMethod = "은(는) 존재하지않는 메소드명 입니다."; 9 | String doNotFind = "은(는) 정의되지 않은 변수 입니다."; 10 | String doNotDefine = "은(는) 정의 되지 않은 타입입니다."; 11 | String noHaveInitial = "초기값이 존재하지 않습니다."; 12 | String noHaveVarName = "변수명이 존재하지 않습니다."; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/system/start/keyword/SpecialKeyword.java: -------------------------------------------------------------------------------- 1 | package system.start.keyword; 2 | 3 | import system.work.SystemWork; 4 | 5 | import java.util.regex.Pattern; 6 | 7 | public abstract class SpecialKeyword implements SystemWork { 8 | private final Pattern pattern; 9 | 10 | public SpecialKeyword(String patternText) { 11 | this.pattern = Pattern.compile("^\\s*" + patternText + "\\s*$"); 12 | } 13 | 14 | @Override 15 | public boolean check(String line) { 16 | return pattern.matcher(line).find(); 17 | } 18 | 19 | @Override 20 | public abstract void start(String line); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/pattern/MakePattern.java: -------------------------------------------------------------------------------- 1 | package pattern; 2 | 3 | import java.util.regex.Pattern; 4 | 5 | public abstract class MakePattern implements MakePatternWork { 6 | private final Pattern pattern; 7 | 8 | public MakePattern(String pattern) { 9 | this.pattern = Pattern.compile(pattern); 10 | } 11 | 12 | @Override 13 | public boolean check(String line) { 14 | return pattern.matcher(line).find(); 15 | } 16 | 17 | @Override 18 | public Pattern getPattern() { 19 | return pattern; 20 | } 21 | 22 | @Override 23 | public abstract void start(String line); 24 | } 25 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

테스트

9 |

{{:aaa}}

10 | 서브페이지로 가는 링크 11 |
12 | 13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 | 21 |
22 | 23 | -------------------------------------------------------------------------------- /src/main/java/http/controller/create/CreateHTML.java: -------------------------------------------------------------------------------- 1 | package http.controller.create; 2 | 3 | import pattern.MakePatternWork; 4 | 5 | import java.util.regex.Pattern; 6 | 7 | public abstract class CreateHTML implements MakePatternWork { 8 | private final Pattern pattern; 9 | 10 | public CreateHTML(String pattern) { 11 | this.pattern = Pattern.compile(pattern); 12 | } 13 | 14 | @Override 15 | public boolean check(String line) { 16 | return pattern.matcher(line).find(); 17 | } 18 | 19 | @Override 20 | public Pattern getPattern() { 21 | return pattern; 22 | } 23 | 24 | @Override 25 | public abstract void start(String line); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/controller/sql/DDL.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.controller.sql; 2 | 3 | import http.items.Color; 4 | 5 | import java.sql.Connection; 6 | import java.sql.SQLException; 7 | 8 | public class DDL { 9 | 10 | public void create(Connection con, String sql) throws SQLException { 11 | var stat = con.createStatement(); 12 | stat.execute(sql); 13 | } 14 | 15 | public void alter(Connection con, String sql) throws SQLException { 16 | var stat = con.createStatement(); 17 | stat.execute(sql); 18 | } 19 | 20 | public void drop(Connection con, String sql) throws SQLException { 21 | var stat = con.createStatement(); 22 | stat.execute(sql); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/origin/consol/controller/ConsoleScanner.java: -------------------------------------------------------------------------------- 1 | package origin.consol.controller; 2 | 3 | import java.util.Scanner; 4 | import java.util.regex.Pattern; 5 | 6 | public class ConsoleScanner { 7 | private final String patternText; 8 | private final Pattern pattern; 9 | private final Scanner scanner = new Scanner(System.in); 10 | 11 | public ConsoleScanner(String patternText) { 12 | this.patternText = ":" + patternText + "[ _]"; 13 | pattern = Pattern.compile(this.patternText); 14 | } 15 | 16 | public boolean check(String line) { 17 | return pattern.matcher(line).find(); 18 | } 19 | 20 | public String start(String line) { 21 | return line.replaceFirst(patternText, scanner.nextLine()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/controller/MakeArrayVariable.java: -------------------------------------------------------------------------------- 1 | package origin.variable.controller; 2 | 3 | import origin.variable.model.VariableWork; 4 | 5 | import java.util.Map; 6 | import java.util.Set; 7 | import java.util.regex.Pattern; 8 | 9 | public class MakeArrayVariable implements VariableWork { 10 | Pattern pattern; 11 | 12 | public MakeArrayVariable(String pattern) { 13 | //ㅇㅅㅇ[10][13] 변수명:초기값 14 | this.pattern = Pattern.compile(pattern + "(\\[\\d])+ [ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+:"); 15 | } 16 | 17 | @Override 18 | public boolean check(String line) { 19 | return false; 20 | } 21 | 22 | @Override 23 | public void start(String line, Map> repository, Set set) { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/origin/thead/controller/Sleep.java: -------------------------------------------------------------------------------- 1 | package origin.thead.controller; 2 | 3 | import origin.thead.model.ThreadWork; 4 | 5 | import java.util.regex.Matcher; 6 | import java.util.regex.Pattern; 7 | 8 | public class Sleep implements ThreadWork { 9 | // private final String patternText = "^\\s*ㅡ_ㅡ\\s*\\d+"; 10 | // private final Pattern pattern = Pattern.compile(patternText); 11 | private final Pattern pattern; 12 | 13 | public Sleep(String pattern) { 14 | this.pattern = Pattern.compile(pattern); 15 | } 16 | 17 | @Override 18 | public boolean check(String line) { 19 | return pattern.matcher(line).find(); 20 | } 21 | 22 | @Override 23 | public void start(String line) { 24 | Matcher matcher = pattern.matcher(line); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/origin/consol/controller/Println.java: -------------------------------------------------------------------------------- 1 | package origin.consol.controller; 2 | 3 | import origin.consol.define.PrintWork; 4 | import origin.variable.model.Repository; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | public class Println implements PrintWork { 9 | private final String patternText; 10 | private final Pattern pattern; 11 | 12 | public Println(String patternText) { 13 | this.patternText = "(\\n|^)\\s*"+patternText+"($|\\s)"; 14 | this.pattern = Pattern.compile(this.patternText); 15 | } 16 | 17 | @Override 18 | public boolean check(String line) { 19 | return pattern.matcher(line).find(); 20 | } 21 | 22 | @Override 23 | public void start(String line) { 24 | System.out.println(line.replaceFirst(patternText, "")); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/origin/consol/controller/PriorityPrint.java: -------------------------------------------------------------------------------- 1 | package origin.consol.controller; 2 | 3 | import origin.consol.define.PriorityPrintWork; 4 | import origin.variable.model.Repository; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | public class PriorityPrint implements PriorityPrintWork { 9 | private final String PATTERN; 10 | private final Pattern pattern; 11 | 12 | public PriorityPrint(String patternText) { 13 | this.PATTERN = "^\\s*"+patternText+"(\\s|$)"; 14 | this.pattern = Pattern.compile(this.PATTERN); 15 | } 16 | 17 | @Override 18 | public void start(String line) { 19 | System.out.print(line.replaceFirst(PATTERN, "")); 20 | } 21 | 22 | @Override 23 | public boolean check(String line) { 24 | return pattern.matcher(line).find(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/origin/consol/controller/PriorityPrintln.java: -------------------------------------------------------------------------------- 1 | package origin.consol.controller; 2 | 3 | import origin.consol.define.PriorityPrintWork; 4 | import origin.variable.model.Repository; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | public class PriorityPrintln implements PriorityPrintWork { 9 | private final String PATTERN; 10 | private final Pattern pattern; 11 | 12 | public PriorityPrintln(String patternText) { 13 | this.PATTERN = "^\\s*"+patternText+"(\\s|$)"; 14 | this.pattern = Pattern.compile(PATTERN); 15 | } 16 | 17 | @Override 18 | public boolean check(String line) { 19 | return pattern.matcher(line).find(); 20 | } 21 | 22 | @Override 23 | public void start(String line) { 24 | System.out.println(line.replaceFirst(PATTERN, "")); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/origin/consol/controller/Print.java: -------------------------------------------------------------------------------- 1 | package origin.consol.controller; 2 | 3 | import origin.consol.define.PrintWork; 4 | import origin.variable.model.Repository; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | public class Print implements PrintWork { 9 | private final String patternText; 10 | private final Pattern pattern; 11 | 12 | public Print(String patternText) { 13 | this.patternText = "^\\s*"+patternText+"($|\\s)"; 14 | this.pattern = Pattern.compile(this.patternText); 15 | } 16 | 17 | @Override 18 | public boolean check(String line) { 19 | return pattern.matcher(line).find(); 20 | } 21 | 22 | @Override 23 | public void start(String line) { 24 | //ㅅㅁㅅ 출력될 값 => 출력될 값 25 | System.out.print(line.replaceFirst(patternText, "")); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/http/server/Server.java: -------------------------------------------------------------------------------- 1 | package http.server; 2 | 3 | import http.items.Color; 4 | import http.items.HttpRepository; 5 | 6 | public class Server implements HttpRepository { 7 | public static HttpServerManager httpServerManager; 8 | 9 | public Server() { 10 | httpServerManager = new HttpServerManager(); 11 | httpServerManager.start(); 12 | if (pathMap.isEmpty()) { 13 | System.out.printf("%s경로가 존재하지 않습니다.%s\n", Color.RED, Color.RESET); 14 | httpServerManager.stop(); 15 | } 16 | } 17 | 18 | public Server(int port) { 19 | httpServerManager = new HttpServerManager(port); 20 | httpServerManager.start(); 21 | if (pathMap.isEmpty()) { 22 | System.out.printf("%s경로가 존재하지 않습니다.%s\n", Color.RED, Color.RESET); 23 | httpServerManager.stop(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/system/start/exception/Sleep.java: -------------------------------------------------------------------------------- 1 | package system.start.exception; 2 | 3 | import system.work.ThreadWork; 4 | 5 | import java.util.StringTokenizer; 6 | import java.util.regex.Pattern; 7 | 8 | public class Sleep implements ThreadWork { 9 | private final Pattern pattern; 10 | 11 | //ㅡ_ㅡ 100.0 12 | public Sleep(String patternText) { 13 | this.pattern = Pattern.compile("^\\s*" + patternText + "\\s+\\d+\\s*$"); 14 | } 15 | 16 | @Override 17 | public boolean check(String line) { 18 | return pattern.matcher(line).find(); 19 | } 20 | 21 | @Override 22 | public void start(String line) { 23 | StringTokenizer tokenizer = new StringTokenizer(line); 24 | tokenizer.nextToken(); 25 | long count = Long.parseLong(tokenizer.nextToken()); 26 | 27 | try { 28 | Thread.sleep(count); 29 | } catch (InterruptedException ignored) {} 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/http/handler/HttpGetHandler.java: -------------------------------------------------------------------------------- 1 | package http.handler; 2 | 3 | import com.sun.net.httpserver.HttpExchange; 4 | 5 | import java.io.IOException; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | public class HttpGetHandler { 10 | 11 | public HandlerDao handle(HttpExchange exchange) throws IOException { 12 | Map parameters = new HashMap<>(); 13 | var requestUri = exchange.getRequestURI(); 14 | var query = requestUri.getRawQuery(); 15 | var uriParser = new UriParser(); 16 | uriParser.parsesQuery(query, parameters); 17 | //경로를 키 값으로 저장 18 | String path = exchange.getRequestURI().getPath(); // /sub 19 | // HttpRepository.GET.get(path).putAll(parameters); 20 | 21 | var response = new StringBuilder(); 22 | parameters.forEach((key, value) -> response.append(key).append("=").append(value).append(" ")); 23 | return new HandlerDao(response.toString(), path, parameters); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/http/controller/move/MoveGetHttp.java: -------------------------------------------------------------------------------- 1 | package http.controller.move; 2 | 3 | import http.items.HttpRepository; 4 | import http.model.HttpMoveWork; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | //페이지 이동 GET 등록 10 | public class MoveGetHttp implements HttpMoveWork, HttpRepository { 11 | //[API] <<ㅇㅅㅇ< [이동할 페이지] 12 | private final String patternText = "^\\s*\\S+\\s*<<ㅇㅅㅇ<\\s*\\S+"; 13 | private final Pattern pattern = Pattern.compile(patternText); 14 | 15 | @Override 16 | public boolean check(String line) { 17 | return pattern.matcher(line).find(); 18 | } 19 | 20 | @Override 21 | public void move(String line) { 22 | Matcher matcher = pattern.matcher(line); 23 | if (matcher.find()) { 24 | String[] texts = matcher.group().split("\\s*<<ㅇㅅㅇ<\\s*"); 25 | String api = texts[0]; 26 | String movePage = texts[1]; 27 | // GetMove.put(api, movePage); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/math/controller/random/RandomBoolean.java: -------------------------------------------------------------------------------- 1 | package math.controller.random; 2 | 3 | import math.model.RandomWork; 4 | 5 | import java.util.Random; 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public class RandomBoolean implements RandomWork { 10 | private final Random random = new Random(); 11 | private final String patternText; 12 | private final Pattern pattern; 13 | 14 | public RandomBoolean(String patternText) { 15 | this.patternText = ":"+patternText+"[_ ]"; 16 | this.pattern = Pattern.compile(this.patternText); 17 | } 18 | 19 | @Override 20 | public boolean check(String line) { 21 | return pattern.matcher(line).find(); 22 | } 23 | 24 | @Override 25 | public String start(String line) { 26 | Matcher matcher = pattern.matcher(line); 27 | while (matcher.find()) 28 | line = line.replaceFirst(patternText, random.nextBoolean() ? "ㅇㅇ" : "ㄴㄴ"); 29 | return line; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/http/controller/move/MovePostHttp.java: -------------------------------------------------------------------------------- 1 | package http.controller.move; 2 | 3 | import http.items.HttpRepository; 4 | import http.model.HttpMoveWork; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | //페이지 이동 POST 등록 10 | public class MovePostHttp implements HttpMoveWork, HttpRepository { 11 | //[API] <<ㅇㅅㅇ<< [이동할 페이지] 12 | private final String patternText = "^\\s*\\S+\\s*<<ㅇㅅㅇ<<\\s*\\S+"; 13 | private final Pattern pattern = Pattern.compile(patternText); 14 | 15 | @Override 16 | public boolean check(String line) { 17 | return pattern.matcher(line).find(); 18 | } 19 | 20 | @Override 21 | public void move(String line) { 22 | Matcher matcher = pattern.matcher(line); 23 | if (matcher.find()) { 24 | String[] texts = matcher.group().split("\\s*<<ㅇㅅㅇ<<\\s*"); 25 | String api = texts[0]; 26 | String movePage = texts[1]; 27 | // PostMove.put(api, movePage); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/http/controller/StartServer.java: -------------------------------------------------------------------------------- 1 | package http.controller; 2 | 3 | import http.items.HttpRepository; 4 | import http.model.HttpWork; 5 | import http.server.Server; 6 | 7 | import java.util.regex.Pattern; 8 | 9 | public class StartServer implements HttpRepository, HttpWork { 10 | //=[^ㅇㅅㅇ^]= [숫자] 11 | private final String serverPattern; 12 | private final Pattern pattern; 13 | 14 | public StartServer(String patternText) { 15 | this.serverPattern = "^\\s*"+patternText+"(\\s+[0-9]*)?"; 16 | this.pattern = Pattern.compile(serverPattern); 17 | } 18 | 19 | @Override 20 | public boolean check(String line) { 21 | return pattern.matcher(line).find(); 22 | } 23 | 24 | @Override 25 | public void start(String line) { 26 | HttpRepository.startSetting(); 27 | if (Pattern.compile("[0-9]").matcher(line).find()) { 28 | int port = Integer.parseInt(line.replaceAll("[^0-9]", "")); 29 | new Server(port); 30 | } else new Server(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/math/controller/StringCalculation.java: -------------------------------------------------------------------------------- 1 | package math.controller; 2 | 3 | import math.model.CalculationWork; 4 | import origin.variable.model.Repository; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public class StringCalculation implements CalculationWork { 10 | private final String patternText = "\\[[\\s\\S]+]ㅇ=ㅇ\\[[\\s\\S]+]"; 11 | private final Pattern pattern = Pattern.compile(patternText); 12 | 13 | @Override 14 | public boolean check(String line) { 15 | return pattern.matcher(line).find(); 16 | } 17 | 18 | @Override 19 | public String start(String line) { 20 | Matcher matcher = pattern.matcher(line); 21 | while (matcher.find()) { 22 | //[값1]ㅇ=ㅇ[값2] 23 | String[] values = matcher.group().split("ㅇ=ㅇ"); 24 | String value1 = values[0].substring(1, values[0].length()-1); 25 | String value2 = values[1].substring(1, values[1].length()-1); 26 | line = line.replaceFirst(patternText, value1.equals(value2)?"ㅇㅇ":"ㄴㄴ"); 27 | } 28 | return line; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/origin/loop/model/LoopWork.java: -------------------------------------------------------------------------------- 1 | package origin.loop.model; 2 | 3 | import event.Setting; 4 | import origin.loop.controller.If; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | public interface LoopWork { 9 | boolean check(String line); 10 | void start(String line); 11 | String getPattern(); 12 | 13 | default boolean breakCheck(String line) { 14 | return Pattern.compile("^\\s*ㅂㅇㅂ\\s*$").matcher(line).find(); 15 | } 16 | 17 | default boolean continueCheck(String line) { 18 | return Pattern.compile("^\\s*ㅋㅇㅋ\\s*$").matcher(line).find(); 19 | } 20 | 21 | //break, continue 확인 하고 출력 22 | //실행까지 동작함 23 | default BreakContinue settingStart(String line) { 24 | line = Setting.startString(line); 25 | for (String l : If.lineStart(line).split("\\n")) { 26 | if (breakCheck(line)) return BreakContinue.Break; 27 | if (continueCheck(line)) return BreakContinue.Continue; 28 | Setting.start(l); 29 | } 30 | return BreakContinue.Etc; 31 | } 32 | 33 | enum BreakContinue { 34 | Break, Continue, Etc 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/input/conroller/mouse/controller/MousePositionY.java: -------------------------------------------------------------------------------- 1 | package input.conroller.mouse.controller; 2 | 3 | import input.conroller.mouse.define.MousePositionWork; 4 | 5 | import java.awt.*; 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public class MousePositionY implements MousePositionWork { 10 | private final String patternText; // :ㅁㅇㅁ~ㅅㄹㅅ(_ ) 11 | private final Pattern pattern; 12 | 13 | public MousePositionY(String className, String patternText) { 14 | this.patternText = ":" + className + "~" + patternText + "[ _]"; 15 | this.pattern = Pattern.compile(this.patternText); 16 | } 17 | 18 | @Override 19 | public boolean check(String line) { 20 | return pattern.matcher(line).find(); 21 | } 22 | 23 | @Override 24 | public String start(String line) { 25 | Matcher matcher = pattern.matcher(line); 26 | while (matcher.find()) { 27 | var position = MouseInfo.getPointerInfo().getLocation().y; 28 | line = line.replaceFirst(this.patternText, String.valueOf(position)); 29 | } 30 | return line; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/input/conroller/mouse/controller/MousePositionXY.java: -------------------------------------------------------------------------------- 1 | package input.conroller.mouse.controller; 2 | 3 | import input.conroller.mouse.define.MousePositionWork; 4 | 5 | import java.awt.*; 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public class MousePositionXY implements MousePositionWork { 10 | private final String patternText; // :ㅁㅇㅁ~ㄱㄹㅅ(_ ) 11 | private final Pattern pattern; 12 | 13 | public MousePositionXY(String className, String patternText) { 14 | this.patternText = ":" + className + "~" + patternText + "[ _]"; 15 | this.pattern = Pattern.compile(this.patternText); 16 | } 17 | 18 | @Override 19 | public boolean check(String line) { 20 | return pattern.matcher(line).find(); 21 | } 22 | 23 | @Override 24 | public String start(String line) { 25 | Matcher matcher = pattern.matcher(line); 26 | while (matcher.find()) { 27 | var position = MouseInfo.getPointerInfo().getLocation().x; 28 | line = line.replaceFirst(this.patternText, String.valueOf(position)); 29 | } 30 | return line; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/controller/sql/DML.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.controller.sql; 2 | 3 | import http.items.Color; 4 | 5 | import java.sql.Connection; 6 | import java.sql.SQLException; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | public class DML { 11 | 12 | public List select(Connection con, String sql, String values) throws SQLException { 13 | List list = new ArrayList<>(); 14 | var stat= con.createStatement(); 15 | var ret = stat.executeQuery(sql); 16 | while (ret.next()) list.add(ret.getString(values)); 17 | return list; 18 | } 19 | 20 | public void insert(Connection con, String sql) throws SQLException { 21 | var stat = con.createStatement(); 22 | stat.executeUpdate(sql); 23 | } 24 | 25 | public void update(Connection con, String sql) throws SQLException { 26 | var stat = con.createStatement(); 27 | stat.executeUpdate(sql); 28 | } 29 | 30 | public void delete(Connection con, String sql) throws SQLException { 31 | var stat = con.createStatement(); 32 | stat.executeUpdate(sql); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/http/controller/PortVariable.java: -------------------------------------------------------------------------------- 1 | package http.controller; 2 | 3 | import http.items.HttpRepository; 4 | import http.model.HttpWork; 5 | import origin.exception.VariableException; 6 | import origin.exception.VariableMessage; 7 | import origin.variable.model.Repository; 8 | 9 | import java.util.StringTokenizer; 10 | import java.util.regex.Pattern; 11 | 12 | public class PortVariable implements HttpWork, Repository { 13 | //=(^ㅇㅅㅇ^)= [키]:[값] 14 | private final String webVar = "^\\s*<ㅇㅅㅇ> +[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+:[\\s\\S]+"; 15 | private final Pattern pattern = Pattern.compile(webVar); 16 | 17 | @Override 18 | public boolean check(String line) { 19 | return pattern.matcher(line).find(); 20 | } 21 | 22 | //변수를 넣음 23 | @Override 24 | public void start(String line) { 25 | line = line.replaceFirst("^\\s*<ㅇㅅㅇ> +", ""); 26 | StringTokenizer tokenizer = new StringTokenizer(line, ":"); 27 | String key = tokenizer.nextToken().strip(); 28 | String value = tokenizer.nextToken(); 29 | if (set.contains(key)) throw new VariableException(key + VariableMessage.sameVariable); 30 | HttpRepository.partMap.put(key, value); 31 | set.add(key); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/controller/DatabaseCheck.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.controller; 2 | 3 | import http.controller.db.define.SelectWork; 4 | 5 | import java.util.regex.Matcher; 6 | import java.util.regex.Pattern; 7 | 8 | public class DatabaseCheck implements SelectWork { 9 | //?ㄷㅇㄷ?[Driver] 10 | private final String patternText = ":\\?ㄷㅇㄷ\\?\\[[^\\[\\]]+][ _]"; 11 | private final Pattern pattern = Pattern.compile(patternText); 12 | 13 | @Override 14 | public boolean check(String line) { 15 | return pattern.matcher(line).find(); 16 | } 17 | 18 | @Override 19 | public String start(String line) { 20 | Matcher matcher = pattern.matcher(line); 21 | while (matcher.find()) { 22 | String group = matcher.group().trim(); 23 | String value = group.substring(7, group.length() - 2); 24 | line = line.replaceFirst(patternText, checkDriver(value)?" ㅇㅇ ":" ㄴㄴ "); 25 | } 26 | return line; 27 | } 28 | 29 | private boolean checkDriver(String driver) { 30 | try { 31 | Class.forName (driver); 32 | return true; 33 | } catch (ClassNotFoundException e) { 34 | return false; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/system/start/exception/TryCatch.java: -------------------------------------------------------------------------------- 1 | package system.start.exception; 2 | 3 | import event.Setting; 4 | import origin.variable.model.Repository; 5 | import system.work.ThreadWork; 6 | 7 | import java.util.regex.Pattern; 8 | 9 | public class TryCatch implements ThreadWork { 10 | private final String patternText; 11 | private final Pattern pattern; 12 | 13 | public TryCatch(String patternText) { 14 | this.patternText = "^\\s*" + patternText + "\\s*"; 15 | this.pattern = Pattern.compile(this.patternText); 16 | } 17 | 18 | @Override 19 | public boolean check(String line) { 20 | return pattern.matcher(line).find(); 21 | } 22 | 23 | @Override 24 | public void start(String line) { 25 | line = line.replaceFirst(patternText, ""); 26 | if (line.isBlank()) return; 27 | if (Repository.uuidMap.containsKey(line.trim())) { 28 | String total = Repository.uuidMap.get(line.trim()); 29 | try { 30 | for (String lines : total.split("\\n")) Setting.start(lines); 31 | } catch (Exception ignored) {} 32 | } else { 33 | try { 34 | Setting.start(line); 35 | } catch (Exception ignored) {} 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/input/conroller/mouse/controller/MousePositionX.java: -------------------------------------------------------------------------------- 1 | package input.conroller.mouse.controller; 2 | 3 | import input.conroller.mouse.define.MousePositionWork; 4 | 5 | import java.awt.*; 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public class MousePositionX implements MousePositionWork { 10 | private final String patternText; // :ㅁㅇㅁ~ㄱㄹㄱ(_ ) 11 | private final Pattern pattern; 12 | 13 | public MousePositionX(String className, String patternText) { 14 | this.patternText = ":" + className + "~" + patternText + "[ _]"; 15 | this.pattern = Pattern.compile(this.patternText); 16 | } 17 | 18 | @Override 19 | public boolean check(String line) { 20 | return pattern.matcher(line).find(); 21 | } 22 | 23 | @Override 24 | public String start(String line) { 25 | Matcher matcher = pattern.matcher(line); 26 | while (matcher.find()) { 27 | var positionX = MouseInfo.getPointerInfo().getLocation().x; 28 | var positionY = MouseInfo.getPointerInfo().getLocation().y; 29 | String builder = "[" + positionX + ", " + positionY + "]"; 30 | line = line.replaceFirst(this.patternText, builder); 31 | } 32 | return line; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/http/handler/HttpPostHandler.java: -------------------------------------------------------------------------------- 1 | package http.handler; 2 | 3 | import com.sun.net.httpserver.HttpExchange; 4 | import event.Setting; 5 | import http.items.HttpRepository; 6 | 7 | import java.io.BufferedReader; 8 | import java.io.IOException; 9 | import java.io.InputStreamReader; 10 | import java.nio.charset.StandardCharsets; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | public class HttpPostHandler extends Setting implements HttpRepository { 15 | public HandlerDao handle(HttpExchange exchange) throws IOException { 16 | Map parameters = new HashMap<>(); 17 | var isr = new InputStreamReader(exchange.getRequestBody(), StandardCharsets.UTF_8); 18 | var br = new BufferedReader(isr); 19 | var query = br.readLine(); 20 | var uriParse = new UriParser(); 21 | uriParse.parsesQuery(query, parameters); 22 | //경로를 키 값으로 저장 23 | String path = exchange.getRequestURI().getPath(); 24 | // HttpRepository.POST.get(path).putAll(parameters); 25 | 26 | var response = new StringBuilder(); 27 | parameters.forEach((key, value) -> response.append(key).append("=").append(value).append(" ")); 28 | return new HandlerDao(response.toString(), path, parameters); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/etc/reader/infor/otl/console.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "강제 출력", 4 | "rescue": "!ㅅㅁㅅ!", 5 | "grammar": "!ㅅㅁㅅ! <출력내용>", 6 | "version": "2.0.0", 7 | "explanation": "출력을 강제로 출력 합니다.", 8 | "example": "ㅇㅁㅇ 변수:안녕
!ㅅㅁㅅ! :변수 녕하세
!ㅅㅁㅅ! 요", 9 | "print": ":변수 녕하세요" 10 | }, 11 | { 12 | "name": "강제 출력 줄바꿈", 13 | "rescue": "!ㅆㅁㅆ!", 14 | "grammar": "!ㅆㅁㅆ! <출력내용>", 15 | "version": "2.0.0", 16 | "explanation": "줄바꿈이 있는 출력을 강제로 합니다.", 17 | "example": "ㅇㅁㅇ 변수:안녕
!ㅆㅁㅆ! :변수 녕하세
!ㅆㅁㅆ! 요", 18 | "print": ":변수 녕하세
요" 19 | }, 20 | { 21 | "name": "출력", 22 | "rescue": "ㅅㅁㅅ", 23 | "grammar": "ㅅㅁㅅ <출력내용>", 24 | "version": "1.0.0", 25 | "explanation": "출력내용을 출력합니다.", 26 | "example": "ㅇㅁㅇ 변수:안녕
ㅅㅁㅅ :변수 녕하세
ㅅㅁㅅ 요", 27 | "print": "안녕하세요" 28 | }, 29 | { 30 | "name": "출력 줄바꿈", 31 | "rescue": "ㅆㅁㅆ", 32 | "grammar": "ㅆㅁㅆ <출력내용>", 33 | "version": "1.0.0", 34 | "explanation": "줄바꿈이 존재하는 출력을 합니다.", 35 | "example": "ㅆㅁㅆ 안녕
ㅆㅁㅆ 하세요.", 36 | "print": "안녕
하세요." 37 | }, 38 | { 39 | "name": "입력", 40 | "rescue": "ㅅㅇㅅ", 41 | "grammar": "ㅅㅇㅅ", 42 | "version": "1.0.0", 43 | "explanation": "라인 1줄의 입력을 받습니다.", 44 | "example": "ㅅㅁㅅ ㅅㅇㅅ
입력 : 안녕", 45 | "print": "안녕" 46 | } 47 | ] -------------------------------------------------------------------------------- /src/main/java/input/conroller/Mouse.java: -------------------------------------------------------------------------------- 1 | package input.conroller; 2 | 3 | import java.awt.*; 4 | import java.awt.event.KeyEvent; 5 | import java.util.regex.Pattern; 6 | 7 | public class Mouse { 8 | 9 | public static void main(String[] args) { 10 | 11 | KeyboardController controller = new KeyboardController(); 12 | controller.checkButton("a", "ag", "ag"); 13 | 14 | System.out.println(MouseInfo.getPointerInfo().getLocation()); 15 | // while (true) { 16 | // 17 | // System.out.println(KeyEvent.getKeyText(KeyEvent.VK_A)); 18 | // try { 19 | // Thread.sleep(1000); 20 | // } catch (Exception ignored) {} 21 | // } 22 | 23 | // PointerInfo info = MouseInfo.getPointerInfo(); 24 | // try { 25 | // Robot robot = new Robot(); 26 | // 27 | // } catch (AWTException e) { 28 | // e.printStackTrace(); 29 | // } 30 | // 31 | // while (true) { 32 | // info = MouseInfo.getPointerInfo(); 33 | // System.out.println(info.getLocation().getX()); 34 | // System.out.println(info.getLocation().getY()); 35 | // 36 | // try { 37 | // Thread.sleep(1000); 38 | // } catch (Exception ignored) {} 39 | // } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/http/server/HttpServerManager.java: -------------------------------------------------------------------------------- 1 | package http.server; 2 | 3 | import com.sun.net.httpserver.HttpServer; 4 | import http.items.Color; 5 | import http.items.HttpRepository; 6 | 7 | import java.io.IOException; 8 | import java.net.InetSocketAddress; 9 | import java.util.HashMap; 10 | 11 | public class HttpServerManager implements HttpRepository { 12 | private static String DEF_HOST = "localhost"; 13 | private static final int DEF_PORT = 9090; 14 | private HttpServer server; 15 | 16 | public HttpServerManager() {createServer(DEF_HOST, DEF_PORT);} 17 | public HttpServerManager(int port) {createServer(DEF_HOST, port);} 18 | 19 | public void start() { 20 | server.start(); 21 | } 22 | 23 | public void stop() { 24 | server.stop(0); 25 | } 26 | 27 | public void setHost(String host) { 28 | DEF_HOST = host; 29 | } 30 | 31 | //서버 생성 32 | private void createServer(String host, int port) { 33 | System.out.printf("URL http://%s:%d/%n", host, port); 34 | try { 35 | server = HttpServer.create(new InetSocketAddress(host, port), 0); 36 | HttpRepository.pathMap.forEach((k, v) -> server.createContext(k, new RootHandler())); 37 | } catch (IOException e) { 38 | System.out.printf("%s서버 생성에 실패하였습니다.%s\n", Color.RED, Color.RESET); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/http/handler/UriParser.java: -------------------------------------------------------------------------------- 1 | package http.handler; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.net.URLDecoder; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | public class UriParser { 10 | public void parsesQuery(String query, Map parameter) throws UnsupportedEncodingException { 11 | if (query != null) { 12 | for (String pair : query.split("&")) { 13 | var params = pair.split("="); 14 | String key = null; 15 | String value = null; 16 | if (params.length > 0) key = URLDecoder.decode(params[0], System.getProperty("file.encoding")); 17 | if (params.length > 1) value = URLDecoder.decode(params[1], System.getProperty("file.encoding")); 18 | 19 | if (parameter.containsKey(key)) { 20 | Object obj = parameter.get(key); 21 | if(obj instanceof List) return; 22 | else if (obj instanceof String) { 23 | List values = new ArrayList<>(); 24 | values.add((String) obj); 25 | values.add(value); 26 | parameter.put(key, values); 27 | } 28 | } else parameter.put(key, value); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/event/Controller.java: -------------------------------------------------------------------------------- 1 | package event; 2 | 3 | import custom.registration.controller.DefineCustomClass; 4 | import custom.registration.controller.DefineMainMethod; 5 | import custom.tool.CustomGetVariable; 6 | import custom.tool.CustomSetVariable; 7 | import event.list.ListSetting; 8 | import http.controller.HttpGetPost; 9 | import http.controller.PortVariable; 10 | import origin.consol.controller.ConsoleScanner; 11 | import origin.loop.define.Bracket; 12 | import origin.variable.controller.GetVariable; 13 | import origin.variable.controller.SetVariable; 14 | import system.start.Finish; 15 | import system.work.FinishWork; 16 | 17 | public interface Controller extends ListSetting { 18 | //변수 19 | GetVariable getVariable = new GetVariable(); 20 | SetVariable setVariable = new SetVariable(); 21 | ConsoleScanner consoleScanner = new ConsoleScanner("ㅅㅇㅅ"); //출력, 입력 22 | Bracket bracket = new Bracket(); //괄호를 토큰으로 변환 23 | PortVariable portVariable = new PortVariable(); //html 전용 변수 24 | HttpGetPost httpGetPost = new HttpGetPost(); //post, get 값 가져오기 25 | //시스템 26 | FinishWork finishWork = new Finish("ㄲㅌㄲ"); //강제 종료 27 | // 커스텀 클래스 28 | DefineCustomClass defineCustomClass = new DefineCustomClass("ㅋㅅㅋ"); 29 | DefineMainMethod defineMainMethod = new DefineMainMethod("ㅁㅅㅁ"); 30 | CustomGetVariable customGetVariableWork = new CustomGetVariable(); 31 | CustomSetVariable customSetVariableWork = new CustomSetVariable(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/http/controller/HTMLVariable.java: -------------------------------------------------------------------------------- 1 | package http.controller; 2 | 3 | import event.Setting; 4 | import http.items.Color; 5 | import http.items.HttpRepository; 6 | import http.model.HttpWork; 7 | import origin.exception.FileFailException; 8 | import origin.exception.FileFailMessage; 9 | 10 | import java.io.File; 11 | import java.util.regex.Pattern; 12 | 13 | public class HTMLVariable implements HttpWork, HttpRepository { 14 | //[url 경로] <ㅇㅅㅇ< [페이지 경로] 15 | private final String patternText; 16 | private final String webPage; 17 | private final Pattern pattern; 18 | 19 | public HTMLVariable(String patternText) { 20 | this.patternText = patternText; 21 | this.webPage = "^\\s*\\S+\\s+"+patternText+"\\s+\\S+"; 22 | this.pattern = Pattern.compile(webPage); 23 | } 24 | 25 | @Override 26 | public boolean check(String line) { 27 | return pattern.matcher(line).find(); 28 | } 29 | 30 | //페이지와 값 세팅 31 | @Override 32 | public void start(String line) { 33 | String[] values = line.split(this.patternText); 34 | String url = values[0].strip(); 35 | String page = values[1].strip(); 36 | String pages = Setting.path.equals("") ? page : Setting.path + "/" + page; 37 | if (!new File(pages).exists()) { 38 | System.out.printf("%s%s%s\n", Color.RED, FileFailMessage.doNotFindFile, Color.RESET); 39 | throw new FileFailException(FileFailMessage.doNotFindFile); 40 | } 41 | pathMap.put(url, pages); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/http/server/CreateHTML.java: -------------------------------------------------------------------------------- 1 | package http.server; 2 | 3 | import http.items.HttpRepository; 4 | import origin.variable.model.Repository; 5 | 6 | import java.io.BufferedReader; 7 | import java.io.FileReader; 8 | import java.nio.charset.StandardCharsets; 9 | import java.util.regex.Matcher; 10 | import java.util.regex.Pattern; 11 | 12 | public class CreateHTML implements HttpRepository, Repository { 13 | //{{ :[변수이름] }} 14 | private final String patternText = "\\{\\{\\s*:\\S+\\s*}}"; 15 | private final Pattern pattern = Pattern.compile(patternText); 16 | 17 | //경로에 있는 html 을 읽음 18 | public String changeVariable(String path) { 19 | StringBuilder builder = new StringBuilder(); 20 | try (BufferedReader reader = new BufferedReader(new FileReader(path, StandardCharsets.UTF_8))) { 21 | String text; 22 | while ((text = reader.readLine()) != null) { 23 | text = replaceVariable(text); 24 | builder.append(text).append("\n"); 25 | } 26 | } catch (Exception ignored) {} 27 | return builder.toString(); 28 | } 29 | 30 | //변수를 넣는 작업 31 | private String replaceVariable(String line) { 32 | Matcher matcher = pattern.matcher(line); 33 | if (matcher.find()) { 34 | String variable = matcher.group(); 35 | String var = variable.substring(2, variable.length()-2).strip().substring(1); 36 | if (partMap.containsKey(var)) 37 | line = line.replaceAll(patternText, partMap.get(var)); 38 | } 39 | return line; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/etc/OTLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.1.0", 3 | "founder": "PersesTitan", 4 | "github-link": "https://github.com/OTLanguage", 5 | "kind": "Programming Language", 6 | "help": [ 7 | "!ㅅㅁㅅ! [내용] = 내용을 강제 출력", 8 | "!ㅆㅁㅆ! [내용] = 내용을 강제 출력(줄바꿈)", 9 | "ㅅㅁㅅ [내용] = 내용을 출력", 10 | "ㅆㅁㅆ [내용] = 내용을 출력(줄바꿈)", 11 | "ㅅㅇㅅ = 입력을 받음", 12 | "ㅇㅈㅇ [변수명]:[초기값] = 정수형 변수를 선언", 13 | "ㅇㅉㅇ [변수명]:[초기값] = 쩡수형 변수를 선언", 14 | "ㅇㅂㅇ [변수명]:[초기값] = 블린형 변수를 선언", 15 | "ㅇㅁㅇ [변수명]:[초기값] = 문자형 변수를 선언", 16 | "ㅇㄱㅇ [변수명]:[초기값] = 글자형 변수를 선언", 17 | "ㅇㅅㅇ [변수명]:[초기값] = 실수형 변수를 선언", 18 | "ㅇㅆㅇ [변수명]:[초기값] = 씰수형 변수를 선언", 19 | "ㅇㅇ = 참", 20 | "ㄴㄴ = 거짓", 21 | "ㅇㄴ = not", 22 | "ㄸ = 또는(or)", 23 | "ㄲ = 그리고(and)", 24 | "[숫자]^[숫자]^[숫자] = for 문", 25 | "?ㅅ? [블린] = if 문", 26 | "ㅇ+ㅇ = 더하기", 27 | "ㅇ-ㅇ = 빼기", 28 | "ㅇ/ㅇ = 나누기", 29 | "ㅇ*ㅇ = 곱하기", 30 | "ㅇ%ㅇ = 나머지" 31 | ], 32 | "history": [ 33 | { 34 | "2.1.0": [ 35 | { 36 | "date": "2022-07-18", 37 | "add": [ 38 | "리스트 추가 됨", 39 | "리스트 추가 기능 추가됨", 40 | "리스트 삭제 기능 추가됨", 41 | "리스트 값 가져오기 추가됨", 42 | "변수 가져오기 공백, 언더바(_) 허용" 43 | ] 44 | } 45 | ], 46 | "2.1.1": [ 47 | { 48 | "date": "2022-07-18", 49 | "add": "리스트 배열 값 에러 확인 추가" 50 | } 51 | ], 52 | "2.2.1": [ 53 | { 54 | "date": "2022-07-19", 55 | "add": [ 56 | "리스트 변수, 일반 변수 영어로 허용", 57 | "foreach 추가 ([변수]^^[변수])" 58 | ] 59 | } 60 | ] 61 | } 62 | ] 63 | } -------------------------------------------------------------------------------- /src/main/java/origin/variable/controller/GetVariable.java: -------------------------------------------------------------------------------- 1 | package origin.variable.controller; 2 | 3 | import http.items.HttpRepository; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.exception.VariableException; 7 | import origin.exception.VariableMessage; 8 | import origin.variable.model.Repository; 9 | 10 | import java.util.Map; 11 | import java.util.regex.Matcher; 12 | import java.util.regex.Pattern; 13 | 14 | //변수를 불러와서 대치하는 작업 15 | public class GetVariable { 16 | public static final String patternText = ":[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+[ _]"; //:변수명( ) 17 | private final Pattern pattern = Pattern.compile(patternText); 18 | 19 | public boolean check(String line) { 20 | Pattern pattern = Pattern.compile("[^:]?"+patternText); 21 | return pattern.matcher(line).find(); 22 | } 23 | 24 | public String start(String line, Map> repository) { 25 | Matcher matcher = pattern.matcher(line); 26 | while (matcher.find()) { 27 | String group = matcher.group(); 28 | int pos = group.length(); 29 | String key = group.substring(1, pos-1); //:변수명 => 변수명 30 | for (String keys : repository.keySet()) { 31 | if (repository.get(keys).containsKey(key)) 32 | line = line.replaceAll(patternText, repository.get(keys).get(key).toString()); 33 | if (HttpRepository.partMap.containsKey(key)) 34 | line = line.replaceAll(patternText, HttpRepository.partMap.get(key)); 35 | } 36 | } 37 | return line; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/input/conroller/KeyboardController.java: -------------------------------------------------------------------------------- 1 | package input.conroller; 2 | 3 | import java.awt.*; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.Locale; 8 | import java.util.function.Predicate; 9 | import java.util.stream.Collectors; 10 | 11 | public class KeyboardController { 12 | public static Robot robot; 13 | 14 | public KeyboardController() { 15 | try { 16 | robot = new Robot(); 17 | } catch (AWTException e) { 18 | robot = null; 19 | } 20 | } 21 | 22 | public boolean check(String line) { 23 | if (robot == null) return false; 24 | return false; 25 | } 26 | 27 | public void start() { 28 | 29 | } 30 | 31 | // (ex) Shift A, Ctrl C 32 | protected void checkButton(String...keys) { 33 | if (robot == null) { 34 | System.out.println("No have Keys"); 35 | } 36 | List list = new ArrayList<>(); 37 | for (String key : keys) { 38 | key = key.trim().toUpperCase(Locale.ROOT); 39 | if (!KeyboardRepository.keys.containsKey(key)) continue; 40 | list.add(KeyboardRepository.keys.get(key)); 41 | } 42 | 43 | Arrays.stream(keys) 44 | .map(String::trim) 45 | .map(String::toUpperCase) 46 | .filter(KeyboardRepository.keys::containsKey) 47 | .map(KeyboardRepository.keys::get) 48 | .forEach(robot::keyPress); 49 | 50 | list.forEach(System.out::println); 51 | // list.forEach(robot::keyPress); 52 | // list.forEach(robot::keyRelease); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/math/controller/random/RandomLong.java: -------------------------------------------------------------------------------- 1 | package math.controller.random; 2 | 3 | import math.model.RandomWork; 4 | import origin.exception.RandomException; 5 | import origin.exception.RandomMessage; 6 | 7 | import java.util.Random; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | public class RandomLong implements RandomWork { 12 | private final Random random = new Random(); 13 | private final String patternText; 14 | private final Pattern pattern; 15 | 16 | public RandomLong(String patternText) { 17 | this.patternText = ":(\\d+\\s*"+patternText+"\\s*\\d+|"+patternText+")[_ ]"; 18 | this.pattern = Pattern.compile(this.patternText); 19 | } 20 | 21 | @Override 22 | public boolean check(String line) { 23 | return pattern.matcher(line).find(); 24 | } 25 | 26 | @Override 27 | public String start(String line) { 28 | Matcher matcher = pattern.matcher(line); 29 | while (matcher.find()) { 30 | String text = matcher.group(); 31 | text = text.substring(1, text.length()-1); 32 | if (Pattern.compile("\\d").matcher(text).find()) { 33 | String[] values = text.split("@ㅉ@"); 34 | long num1 = Long.parseLong(values[0].strip()); 35 | long num2 = Long.parseLong(values[1].strip()); 36 | if (num1 == num2) throw new RandomException(RandomMessage.randomSame); 37 | line = line.replaceFirst(patternText, Long.toString(random.nextLong(num1, num2))); 38 | } else line = line.replaceFirst(patternText, Long.toString(random.nextLong())); 39 | } 40 | return line; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/math/controller/random/RandomFloat.java: -------------------------------------------------------------------------------- 1 | package math.controller.random; 2 | 3 | import math.model.RandomWork; 4 | import origin.exception.RandomException; 5 | import origin.exception.RandomMessage; 6 | 7 | import java.util.Random; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | public class RandomFloat implements RandomWork { 12 | private final Random random = new Random(); 13 | private final String patternText; 14 | private final Pattern pattern; 15 | 16 | public RandomFloat(String patternText) { 17 | this.patternText = ":((\\d+\\.\\d+)\\s*"+patternText+"\\s*(\\d+\\.\\d+)|"+patternText+")[_ ]"; 18 | this.pattern = Pattern.compile(this.patternText); 19 | } 20 | 21 | @Override 22 | public boolean check(String line) { 23 | return pattern.matcher(line).find(); 24 | } 25 | 26 | @Override 27 | public String start(String line) { 28 | Matcher matcher = pattern.matcher(line); 29 | while (matcher.find()) { 30 | String gr = matcher.group(); 31 | gr = gr.substring(1, gr.length()-1); 32 | if (Pattern.compile("\\d").matcher(gr).find()) { 33 | var value = gr.split("@ㅅ@"); 34 | float num1 = Float.parseFloat(value[0].strip()); 35 | float num2 = Float.parseFloat(value[1].strip()); 36 | if (num1 == num2) throw new RandomException(RandomMessage.randomSame); 37 | line = line.replaceFirst(patternText, Float.toString(random.nextFloat(num1, num2))); 38 | } else line = line.replaceFirst(patternText, Float.toString(random.nextFloat())); 39 | } 40 | return line; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/math/controller/random/RandomDouble.java: -------------------------------------------------------------------------------- 1 | package math.controller.random; 2 | 3 | import math.model.RandomWork; 4 | import origin.exception.RandomException; 5 | import origin.exception.RandomMessage; 6 | 7 | import java.util.Random; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | public class RandomDouble implements RandomWork { 12 | private final Random random = new Random(); 13 | private final String patternText; 14 | private final Pattern pattern; 15 | 16 | public RandomDouble(String patternText) { 17 | this.patternText = ":((\\d+\\.\\d+)\\s*"+patternText+"\\s*(\\d+\\.\\d+)|"+patternText+")[_ ]"; 18 | this.pattern = Pattern.compile(this.patternText); 19 | } 20 | 21 | @Override 22 | public boolean check(String line) { 23 | return pattern.matcher(line).find(); 24 | } 25 | 26 | @Override 27 | public String start(String line) { 28 | Matcher matcher = pattern.matcher(line); 29 | while (matcher.find()) { 30 | String gr = matcher.group(); 31 | gr = gr.substring(1, gr.length()-1); 32 | if (Pattern.compile("\\d").matcher(gr).find()) { 33 | var value = gr.split("@ㅆ@"); 34 | double num1 = Double.parseDouble(value[0].strip()); 35 | double num2 = Double.parseDouble(value[1].strip()); 36 | if (num1 == num2) throw new RandomException(RandomMessage.randomSame); 37 | line = line.replaceFirst(patternText, Double.toString(random.nextDouble(num1, num2))); 38 | } else line = line.replaceFirst(patternText, Double.toString(random.nextDouble())); 39 | } 40 | return line; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/math/controller/random/RandomInteger.java: -------------------------------------------------------------------------------- 1 | package math.controller.random; 2 | 3 | import math.model.RandomWork; 4 | import origin.exception.RandomException; 5 | import origin.exception.RandomMessage; 6 | 7 | import java.util.Random; 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | //정수 램던 생성 12 | public class RandomInteger implements RandomWork { 13 | private final Random random = new Random(); 14 | private final String patternText; 15 | private final Pattern pattern; 16 | 17 | public RandomInteger(String patternText) { 18 | this.patternText = ":(\\d+\\s*"+patternText+"\\s*\\d+|"+patternText+")[ _]"; 19 | this.pattern = Pattern.compile(this.patternText); 20 | } 21 | 22 | @Override 23 | public boolean check(String line) { 24 | return pattern.matcher(line).find(); 25 | } 26 | 27 | @Override 28 | public String start(String line) { 29 | Matcher matcher = pattern.matcher(line); 30 | while (matcher.find()) { 31 | String text = matcher.group(); 32 | text = text.substring(1, text.length()-1); 33 | if (Pattern.compile("\\d").matcher(text).find()) { 34 | String[] values = text.split("@ㅈ@"); 35 | int num1 = Integer.parseInt(values[0].strip()); 36 | int num2 = Integer.parseInt(values[1].strip()); 37 | if (num1 == num2) throw new RandomException(RandomMessage.randomSame); 38 | line = line.replaceFirst(patternText, Integer.toString(random.nextInt(num1, num2))); 39 | } else line = line.replaceFirst(patternText, Integer.toString(random.nextInt())); 40 | } 41 | return line; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/controller/pattern/DataBaseShell.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.controller.pattern; 2 | 3 | import event.db.DBSetting; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.loop.model.LoopWork; 7 | 8 | import java.sql.SQLException; 9 | import java.util.regex.Matcher; 10 | import java.util.regex.Pattern; 11 | 12 | //클래스 정의 13 | public abstract class DataBaseShell implements LoopWork { 14 | private final int count; 15 | private final String className; 16 | private final String patternText; 17 | private final Pattern pattern; 18 | 19 | public DataBaseShell(String className, int count) { 20 | this.count = count; 21 | this.className = className; 22 | patternText = "^\\s*" + className + "\\[[^\\[\\]]+]".repeat(Math.max(0, count)); 23 | pattern = Pattern.compile(patternText); 24 | } 25 | 26 | @Override 27 | public boolean check(String line) { 28 | if (DBSetting.databaseSetting != null) return false; 29 | return pattern.matcher(line).find(); 30 | } 31 | 32 | public String[] getValues(Matcher matcher) { 33 | if (matcher.find()) { 34 | String group = matcher.group().trim(); 35 | String[] values = group 36 | .substring(className.length()+1, group.length()-1) 37 | .split("]\\["); 38 | if (values.length != count) throw new MatchException(MatchMessage.grammarError); 39 | else return values; 40 | } 41 | throw new MatchException(MatchMessage.grammarError); 42 | } 43 | 44 | @Override 45 | public abstract void start(String line); 46 | 47 | @Override 48 | public String getPattern() { 49 | return patternText; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/http/controller/HttpGetPost.java: -------------------------------------------------------------------------------- 1 | package http.controller; 2 | 3 | import http.items.HttpRepository; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.loop.model.LoopWork; 7 | 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | //GET 과 POST 값 가져오는 작업 12 | public class HttpGetPost implements HttpRepository, LoopWork { 13 | //[경로] [POST,GET]>ㅇㅅㅇ>[name] 14 | //[POST,GET][경로]>ㅇㅅㅇ>[변수1:query1, 변수2:query2] 15 | 16 | // private final String patternText = "\\S+\\s+(POST|GET)\\s*>ㅇㅅㅇ>\\s*\\S+"; 17 | private final String patternText = "^\\s*(POST|GET)\\s*\\S+\\s*>ㅇㅅㅇ>\\s*\\[([^\\[\\]:,]+:[^\\[\\]:,]+)+]"; 18 | private final Pattern pattern = Pattern.compile(patternText); 19 | 20 | @Override 21 | public boolean check(String line) { 22 | return pattern.matcher(line).find(); 23 | } 24 | 25 | @Override 26 | public void start(String line) { 27 | Matcher matcher = pattern.matcher(line); 28 | if (matcher.find()) { 29 | String[] group = matcher.group().strip().split(">ㅇㅅㅇ>"); 30 | if (group.length != 2) throw new MatchException(MatchMessage.grammarError); 31 | String path = group[0].trim(); // POST/sub 32 | String variable = group[1].trim() + line.replaceFirst(patternText, ""); //[변수1:query1, 변수2:query2] id 33 | if (path.startsWith("POST")) { 34 | path = path.replaceFirst("^POST", "").trim(); 35 | POST.put(path, variable); 36 | } else if (path.startsWith("GET")) { 37 | path = path.replaceFirst("^GET", "").trim(); 38 | GET.put(path, variable); 39 | } 40 | } 41 | } 42 | 43 | @Override 44 | public String getPattern() { 45 | return patternText; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/event/db/DBSetting.java: -------------------------------------------------------------------------------- 1 | package event.db; 2 | 3 | import event.Setting; 4 | import http.controller.db.DatabaseSetting; 5 | import http.controller.db.controller.DatabaseCheck; 6 | import http.controller.db.define.DataBaseWork; 7 | import http.controller.db.define.SelectWork; 8 | import http.controller.db.place.DataBasePlace; 9 | import origin.variable.model.Repository; 10 | 11 | import static event.Controller.getVariable; 12 | 13 | public class DBSetting implements DBRepository, Repository, 14 | DataBasePlace { 15 | public static DatabaseSetting databaseSetting = null; 16 | 17 | public static String start(String line) { 18 | if (line.isBlank()) return null; 19 | if (dataBaseClass.check(line)) {dataBaseClass.start(line); return null;} 20 | if (dataBaseClass1.check(line)) {dataBaseClass1.start(line); return null;} 21 | 22 | line = Setting.startString(line); //변수 불러오기 23 | // if (getVariable.check(line)) line = getVariable.start(line); //변수 불러오기 24 | for (SelectWork works : selectWorks) {if (works.check(line)) line = works.start(line);} 25 | for (DataBaseWork works : dbWorks) {if (works.check(line)) {works.start(line);return null;}} 26 | 27 | return line; 28 | } 29 | 30 | public void firstStart() { 31 | reset(); 32 | //ㄷㅇㄷ[종류, ip, port, dbName, user, password] 33 | loopWorks.add(dataBaseClass); //루프 34 | loopWorks.add(dataBaseClass1); 35 | 36 | selectWorks.add(new DatabaseCheck()); //지원하는 디비인지 확인 37 | selectWorks.add(selectWork); //select 38 | 39 | dbWorks.add(sqlWork); //alter, commit, ... 40 | } 41 | 42 | public void reset() { 43 | dbWorks.clear(); 44 | selectWorks.clear(); 45 | } 46 | 47 | public boolean check(String line) { 48 | return line.contains(className); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/model/Repository.java: -------------------------------------------------------------------------------- 1 | package origin.variable.model; 2 | 3 | import custom.use.controller.UseCustomClass; 4 | import custom.use.controller.UseCustomString; 5 | import custom.use.controller.UseCustomVoid; 6 | import etc.reader.define.FileWork; 7 | import http.model.HttpWork; 8 | import input.conroller.mouse.define.MousePositionWork; 9 | import math.model.CalculationWork; 10 | import math.model.RandomWork; 11 | import origin.consol.define.PrintWork; 12 | import origin.consol.define.PriorityPrintWork; 13 | import origin.loop.model.LoopWork; 14 | import system.work.SystemWork; 15 | import system.work.ThreadWork; 16 | 17 | import java.util.*; 18 | 19 | public interface Repository { 20 | List variableWorks = new ArrayList<>(); //실행할 메소드 저장 21 | List priorityPrintWorks = new ArrayList<>(); //강제 출력 메소드 저장 22 | List printWorks = new ArrayList<>(); //출력 메소드 저장 23 | List calculationWorks = new ArrayList<>(); //계산 메소드 저장 24 | List loopWorks = new ArrayList<>(); //루프 메소드 저장 25 | List httpWorks = new ArrayList<>(); //Http 26 | List randomWorks = new ArrayList<>(); //램던 메소드 저장 27 | List systemWorks = new ArrayList<>(); //시스템 메소드 저장 28 | List threadWorks = new ArrayList<>(); //쓰레드 관련 메소드 저장 29 | List mousePositionWorks = new ArrayList<>(); //마우스 위치 반환 30 | List fileWorks = new ArrayList<>(); //파일 관련 메소드 저장 31 | 32 | Map> repository = new HashMap<>(); //변수 저장 33 | Map uuidMap = new HashMap<>(); //괄호 값 저장하는 곳 34 | Set set = new HashSet<>(); //변수명 저장 35 | Set classList = new HashSet<>(); //클래스 저장하는 곳 36 | 37 | Set classNames = new HashSet<>(); //클래스 이름 38 | Set methods = new HashSet<>(); //메소드 이름 39 | Set customClass = new HashSet<>(); //클래스 메소드 40 | //메소드 저장소 41 | Set useCustomStrings = new HashSet<>(); 42 | Set useCustomVoids = new HashSet<>(); 43 | } -------------------------------------------------------------------------------- /src/main/java/http/controller/db/controller/pattern/DataBaseShellPattern1.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.controller.pattern; 2 | 3 | import http.controller.db.define.DataBaseWork; 4 | import http.controller.db.place.DataBasePlace; 5 | import origin.exception.MatchException; 6 | import origin.exception.MatchMessage; 7 | 8 | import java.util.regex.Matcher; 9 | import java.util.regex.Pattern; 10 | 11 | public abstract class DataBaseShellPattern1 implements DataBaseWork { 12 | private final String patternText; 13 | private final String className; 14 | private final String method; 15 | private final int count; 16 | private final Pattern pattern; 17 | 18 | //[클래스명][메소드명]인자갯수... 19 | public DataBaseShellPattern1(String className, String methodName, int count) { 20 | DataBasePlace.methodName.add(methodName); 21 | this.className = className; 22 | this.method = methodName; 23 | this.count = count; 24 | this.patternText = "^\\s*" + className + "~" + methodName + "\\[[^\\[\\]]+]".repeat(Math.max(0, count)) + "\\s*$"; 25 | pattern = Pattern.compile(patternText); 26 | } 27 | 28 | public String[] getValues(String line) { 29 | Matcher matcher = this.pattern.matcher(line); 30 | if (matcher.find()) { 31 | String group = matcher.group().trim(); 32 | String[] values = group 33 | .substring(className.length()+method.length()+2, group.length()-1) 34 | .split("]\\["); 35 | if (values.length != count) throw new MatchException(MatchMessage.grammarError); 36 | else return values; 37 | } 38 | throw new MatchException(MatchMessage.grammarError); 39 | } 40 | 41 | public Pattern getPattern() { 42 | return pattern; 43 | } 44 | 45 | public String getPatternText() { 46 | return patternText; 47 | } 48 | 49 | @Override 50 | public boolean check(String line) { 51 | return pattern.matcher(line).find(); 52 | } 53 | 54 | @Override 55 | public abstract void start(String line); 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/etc/reader/ReadJSON.java: -------------------------------------------------------------------------------- 1 | package etc.reader; 2 | 3 | import org.json.simple.JSONArray; 4 | import org.json.simple.JSONObject; 5 | import org.json.simple.parser.JSONParser; 6 | 7 | import java.io.FileReader; 8 | import java.io.Reader; 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | public class ReadJSON { 13 | private final static JSONParser parser = new JSONParser(); 14 | 15 | public static String version(String file) { 16 | try (Reader reader = new FileReader("./etc/" + file)) { 17 | JSONObject object = (JSONObject) parser.parse(reader); 18 | return object.get("version").toString(); 19 | } catch (Exception ignored) {} 20 | return ""; 21 | } 22 | 23 | public static String founder(String file) { 24 | try (Reader reader = new FileReader("./etc/" + file)) { 25 | JSONObject object = (JSONObject) parser.parse(reader); 26 | return object.get("founder").toString(); 27 | } catch (Exception ignored) {} 28 | return ""; 29 | } 30 | 31 | public static String github(String file) { 32 | try (Reader reader = new FileReader("./etc/" + file)) { 33 | JSONObject object = (JSONObject) parser.parse(reader); 34 | return object.get("github-link").toString(); 35 | } catch (Exception ignored) {} 36 | return ""; 37 | } 38 | 39 | public static String kind(String file) { 40 | try (Reader reader = new FileReader("./etc/" + file)) { 41 | JSONObject object = (JSONObject) parser.parse(reader); 42 | return object.get("kind").toString(); 43 | } catch (Exception ignored) {} 44 | return ""; 45 | } 46 | 47 | public static List help(String file) { 48 | List list = new ArrayList<>(); 49 | try (Reader reader = new FileReader("./etc/" + file)) { 50 | JSONObject object = (JSONObject) parser.parse(reader); 51 | JSONArray array = (JSONArray) object.get("help"); 52 | for (Object o : array) list.add(o.toString()); 53 | } catch (Exception ignored) {} 54 | return list; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/controller/pattern/DataBaseShellPattern2.java: -------------------------------------------------------------------------------- 1 | package http.controller.db.controller.pattern; 2 | 3 | import http.controller.db.define.DataBaseWork; 4 | import http.controller.db.define.SelectWork; 5 | import http.controller.db.place.DataBasePlace; 6 | import origin.exception.MatchException; 7 | import origin.exception.MatchMessage; 8 | 9 | import java.util.regex.Matcher; 10 | import java.util.regex.Pattern; 11 | 12 | public abstract class DataBaseShellPattern2 implements SelectWork { 13 | private final int count; 14 | private final String patternText; 15 | private final String method; 16 | private final String className; 17 | private final Pattern pattern; 18 | 19 | //[클래스명][메소드명]인자갯수... 20 | public DataBaseShellPattern2(String className, String methodName, int count) { 21 | DataBasePlace.methodName.add(methodName); 22 | this.method = methodName; 23 | this.className = className; 24 | this.count = count; 25 | this.patternText = ":" + className + "~" + methodName + "\\[[^\\[\\]]+]".repeat(Math.max(0, count)) + "[_ ]"; 26 | pattern = Pattern.compile(patternText); 27 | } 28 | 29 | public String[] getValues(String line) { 30 | Matcher matcher = this.pattern.matcher(line); 31 | if (matcher.find()) { 32 | String group = matcher.group(); 33 | group = group.substring(1, group.length()-1); 34 | String[] values = group 35 | .substring(className.length()+method.length()+2, group.length()-1) 36 | .split("]\\["); 37 | if (values.length != count) throw new MatchException(MatchMessage.grammarError); 38 | else return values; 39 | } 40 | throw new MatchException(MatchMessage.grammarError); 41 | } 42 | 43 | @Override 44 | public boolean check(String line) { 45 | return pattern.matcher(line).find(); 46 | } 47 | 48 | @Override 49 | public abstract String start(String line); 50 | 51 | public Pattern getPattern() { 52 | return pattern; 53 | } 54 | 55 | public String getPatternText() { 56 | return patternText; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/input/conroller/KeyboardRepository.java: -------------------------------------------------------------------------------- 1 | package input.conroller; 2 | 3 | import java.awt.event.KeyEvent; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | public interface KeyboardRepository { 8 | Map keys = new HashMap<>() {{ 9 | put("ENTER", KeyEvent.VK_ENTER); 10 | put("0", KeyEvent.VK_0); 11 | put("1", KeyEvent.VK_1); 12 | put("2", KeyEvent.VK_2); 13 | put("3", KeyEvent.VK_3); 14 | put("4", KeyEvent.VK_4); 15 | put("5", KeyEvent.VK_5); 16 | put("6", KeyEvent.VK_6); 17 | put("7", KeyEvent.VK_7); 18 | put("8", KeyEvent.VK_8); 19 | put("9", KeyEvent.VK_9); 20 | put("A", KeyEvent.VK_A); 21 | put("B", KeyEvent.VK_B); 22 | put("C", KeyEvent.VK_C); 23 | put("D", KeyEvent.VK_D); 24 | put("E", KeyEvent.VK_E); 25 | put("F", KeyEvent.VK_F); 26 | put("G", KeyEvent.VK_G); 27 | put("H", KeyEvent.VK_H); 28 | put("I", KeyEvent.VK_I); 29 | put("J", KeyEvent.VK_J); 30 | put("K", KeyEvent.VK_K); 31 | put("L", KeyEvent.VK_L); 32 | put("M", KeyEvent.VK_M); 33 | put("N", KeyEvent.VK_N); 34 | 35 | put("F1", KeyEvent.VK_F1); 36 | put("F2", KeyEvent.VK_F2); 37 | put("F3", KeyEvent.VK_F3); 38 | put("F4", KeyEvent.VK_F4); 39 | put("F5", KeyEvent.VK_F5); 40 | put("F6", KeyEvent.VK_F6); 41 | put("F7", KeyEvent.VK_F7); 42 | put("F8", KeyEvent.VK_F8); 43 | put("F9", KeyEvent.VK_F9); 44 | put("F10", KeyEvent.VK_F10); 45 | put("F11", KeyEvent.VK_F11); 46 | put("F12", KeyEvent.VK_F12); 47 | put("F13", KeyEvent.VK_F13); 48 | put("F14", KeyEvent.VK_F14); 49 | put("F15", KeyEvent.VK_F15); 50 | put("F16", KeyEvent.VK_F16); 51 | put("F17", KeyEvent.VK_F17); 52 | put("F18", KeyEvent.VK_F18); 53 | put("F19", KeyEvent.VK_F19); 54 | put("F20", KeyEvent.VK_F20); 55 | put("F21", KeyEvent.VK_F21); 56 | put("F22", KeyEvent.VK_F22); 57 | put("F23", KeyEvent.VK_F23); 58 | put("F24", KeyEvent.VK_F24); 59 | 60 | 61 | }}; 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/controller/MakeListVariable.java: -------------------------------------------------------------------------------- 1 | package origin.variable.controller; 2 | 3 | import origin.exception.VariableException; 4 | import origin.exception.VariableMessage; 5 | import origin.variable.define.VariableCheck; 6 | import origin.variable.define.VariableType; 7 | import origin.variable.model.Repository; 8 | import origin.variable.model.VariableWork; 9 | 10 | import java.util.ArrayList; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | import java.util.Set; 14 | import java.util.regex.Matcher; 15 | import java.util.regex.Pattern; 16 | 17 | public class MakeListVariable implements VariableWork, Repository { 18 | private final String variable; //ㅇㅅㅇ, ㅇㅁㅇ, ... 19 | private final Pattern pattern; //ㄹㅁㄹ, ㄹㅅㄹ 20 | private final VariableType varType; //Integer, Long, ... 21 | 22 | public MakeListVariable(String variable, VariableType varType) { 23 | this.variable = variable; 24 | this.varType = varType; 25 | String varPattern = "^\\s*" + variable + "\\s+[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+"; 26 | this.pattern = Pattern.compile(varPattern); 27 | repository.put(variable, new HashMap<>()); 28 | } 29 | 30 | @Override 31 | public boolean check(String line) { 32 | return pattern.matcher(line).find(); 33 | } 34 | 35 | @Override 36 | public void start(String line, Map> repository, Set set) { 37 | String patternText = "^\\s*" + variable + "\\s+"; 38 | Pattern pattern = Pattern.compile(patternText); // ㄹㅁㄹ, ㅇㅁㅇ, ... 39 | Matcher matcher = pattern.matcher(line); 40 | if (matcher.find()) { 41 | String type = matcher.group().strip(); //ㄹㅁㄹ, ㅇㅁㅇ, ... 42 | if (!repository.containsKey(type)) throw new VariableException(type + VariableMessage.doNotDefine); 43 | String value = line.replaceFirst(patternText, "").strip(); //변수명 44 | 45 | if (value.isBlank()) throw new VariableException(VariableMessage.noHaveVarName); 46 | if (set.contains(value)) throw new VariableException(type + VariableMessage.sameVariable); 47 | //저장소에 값 저장 48 | repository.get(type).put(value, new ArrayList<>()); 49 | set.add(value); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/origin/loop/controller/If.java: -------------------------------------------------------------------------------- 1 | package origin.loop.controller; 2 | 3 | import event.Setting; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.loop.model.LoopWork; 7 | import origin.variable.model.Repository; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Arrays; 11 | import java.util.List; 12 | import java.util.StringTokenizer; 13 | import java.util.regex.Pattern; 14 | 15 | public class If implements LoopWork, Repository { 16 | //시작 또는 줄바꿈 [공백] ?ㅅ? [공백 1개 이상] 17 | private static final String uuidPattern = "[a-zA-Z0-9-]+"; 18 | private static final String patternText = 19 | "(\\n|^)\\s*\\?ㅅ\\?\\s+(ㅇㅇ|ㄴㄴ)\\s+"+uuidPattern+ //if 20 | "(\\s+\\?ㅈ\\?\\s+(ㅇㅇ|ㄴㄴ)\\s+"+uuidPattern+")*"+ //else if 21 | "(\\?ㅉ\\?\\s+"+uuidPattern+")?"; //else 22 | private static final Pattern pattern = Pattern.compile(patternText); 23 | 24 | @Override 25 | public boolean check(String line) { 26 | return pattern.matcher(line).find(); 27 | } 28 | 29 | @Override 30 | public void start(String line) { 31 | Arrays.stream(lineStart(line).split("\\n")).forEach(Setting::start); 32 | } 33 | 34 | //라인을 반환함 35 | public static String lineStart(String line) { 36 | if (pattern.matcher(line).find()) { 37 | StringTokenizer tokenizer = new StringTokenizer(line); 38 | while (tokenizer.hasMoreTokens()) { 39 | String sing = tokenizer.nextToken(); 40 | switch (sing) { 41 | case "?ㅅ?": 42 | case "?ㅈ?": 43 | if (tokenizer.nextToken().equals("ㅇㅇ")) 44 | return checkUuid(tokenizer.nextToken()); 45 | break; 46 | case "?ㅉ?": 47 | return checkUuid(tokenizer.nextToken()); 48 | } 49 | } 50 | } 51 | return ""; 52 | } 53 | 54 | private static String checkUuid(String key) { 55 | if (uuidMap.containsKey(key)) return uuidMap.get(key); 56 | else throw new MatchException(MatchMessage.grammarError); 57 | } 58 | 59 | @Override 60 | public String getPattern() { 61 | return patternText; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/controller/MakeVariable.java: -------------------------------------------------------------------------------- 1 | package origin.variable.controller; 2 | 3 | import origin.exception.VariableException; 4 | import origin.exception.VariableMessage; 5 | import origin.variable.define.VariableCheck; 6 | import origin.variable.define.VariableType; 7 | import origin.variable.model.Repository; 8 | import origin.variable.model.VariableWork; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import java.util.Set; 13 | import java.util.StringTokenizer; 14 | import java.util.regex.Matcher; 15 | import java.util.regex.Pattern; 16 | 17 | public class MakeVariable implements VariableWork, Repository { 18 | private final String variable; //ㅇㅅㅇ, ㅇㅁㅇ, ... 19 | private final VariableType varType; //Integer, Long, ... 20 | private final Pattern pattern; 21 | private final String varPattern; 22 | 23 | public MakeVariable(String variable, VariableType varType) { 24 | this.variable = variable; 25 | this.varType = varType; 26 | this.varPattern = "^\\s*" + variable + "\\s+[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+:"; 27 | this.pattern = Pattern.compile(varPattern); 28 | repository.put(variable, new HashMap<>()); 29 | } 30 | 31 | @Override 32 | public boolean check(String line) { 33 | return pattern.matcher(line).find(); 34 | } 35 | 36 | @Override 37 | public void start(String line, 38 | Map> repository, 39 | Set set) { 40 | String patternText = "^\\s*" + variable + "\\s+"; 41 | Pattern pattern = Pattern.compile(patternText); // ㅇㅅㅇ, ㅇㅁㅇ, ... 42 | Matcher matcher = pattern.matcher(line); 43 | if (matcher.find()) { 44 | String type = matcher.group().strip(); //ㅇㅅㅇ, ㅇㅁㅇ, ... 45 | if (!repository.containsKey(type)) throw new VariableException(type + VariableMessage.doNotDefine); 46 | //변수:초기값 => 변수 초기값 47 | StringTokenizer tokenizer = new StringTokenizer(line.replaceAll(patternText, ""), ":"); 48 | String key = tokenizer.nextToken(); //변수 49 | String value = line.replaceFirst(varPattern, ""); //초기값 50 | if (set.contains(key)) throw new VariableException(key + VariableMessage.sameVariable); 51 | if (!VariableCheck.check(value, varType)) throw new VariableException(VariableMessage.typeMatchError); 52 | //저장소에 값 저장 53 | repository.get(type).put(key, value); 54 | set.add(key); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/etc/reader/controller/FileRead.java: -------------------------------------------------------------------------------- 1 | package etc.reader.controller; 2 | 3 | import etc.reader.define.FileWork; 4 | import event.Setting; 5 | import origin.exception.FileFailException; 6 | import origin.exception.FileFailMessage; 7 | import system.start.OSSetting; 8 | 9 | import java.io.BufferedReader; 10 | import java.io.File; 11 | import java.io.FileReader; 12 | import java.io.IOException; 13 | import java.nio.charset.StandardCharsets; 14 | import java.util.Arrays; 15 | import java.util.Locale; 16 | import java.util.regex.Matcher; 17 | import java.util.regex.Pattern; 18 | 19 | public class FileRead implements FileWork { 20 | private final String text; // ㅍㅅㅍ 21 | private final String patternText; // ㅍㅅㅍ 디렉토리명/파일명.otl 22 | private final Pattern pattern; 23 | 24 | public FileRead(String patternText) { 25 | this.text = patternText; 26 | // ㅍㅅㅍ 디렉토리명/파일명.otl 27 | this.patternText = "^\\s*" + patternText + "\\s+[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9/\\\\_.-]+"; 28 | this.pattern = Pattern.compile(this.patternText); 29 | } 30 | 31 | @Override 32 | public boolean check(String line) { 33 | return pattern.matcher(line).find(); 34 | } 35 | 36 | @Override 37 | public void start(String line) { 38 | String slash = OSSetting.sep(); // 슬래쉬 반환 39 | Matcher matcher = pattern.matcher(line); 40 | if (matcher.find()) { 41 | String group = matcher.group(); 42 | group = group.replaceFirst("^\\s*" + text, "").strip(); // 디렉토리명/파일명.otl 43 | String path = new File(Setting.path).getParent() + slash + group; 44 | File file = new File(path); 45 | 46 | String text; 47 | StringBuilder total = new StringBuilder(); 48 | if (!file.canRead()) throw new FileFailException(FileFailMessage.doNotReadFile); 49 | if (!path.toLowerCase(Locale.ROOT).endsWith(".otl")) throw new FileFailException(FileFailMessage.notMatchExtension); 50 | try (BufferedReader reader = new BufferedReader(new FileReader(path, StandardCharsets.UTF_8))) { 51 | while ((text = reader.readLine()) != null) total.append(text).append("\n"); 52 | String t = Setting.bracket.bracket(total.toString()); 53 | Arrays.stream(t.split("\\n")).forEach(Setting::start); 54 | } catch (IOException ignored) {} 55 | } 56 | // path../test/hi.otl 57 | // File file = new File(Setting.path + ".." + slash + "test" + slash + "hi.otl"); 58 | 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/origin/loop/controller/NewForEach.java: -------------------------------------------------------------------------------- 1 | package origin.loop.controller; 2 | 3 | import etc.reader.ReadJSON; 4 | import event.Setting; 5 | import origin.exception.MatchException; 6 | import origin.exception.MatchMessage; 7 | import origin.exception.VariableException; 8 | import origin.exception.VariableMessage; 9 | import origin.loop.model.LoopWork; 10 | import origin.variable.define.VariableCheck; 11 | import origin.variable.define.VariableType; 12 | import origin.variable.model.Repository; 13 | 14 | import java.util.Arrays; 15 | import java.util.regex.Matcher; 16 | import java.util.regex.Pattern; 17 | 18 | public class NewForEach implements LoopWork { 19 | private final String patternText = "^\\s*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+\\^\\^\\[[^\\[\\]]+]"; 20 | private final Pattern pattern = Pattern.compile(patternText); 21 | 22 | @Override 23 | public boolean check(String line) { 24 | return pattern.matcher(line).find(); 25 | } 26 | 27 | @Override 28 | public void start(String line) { 29 | Matcher matcher = pattern.matcher(line); 30 | if (matcher.find()) { 31 | // 변수명^^[1, 2] 32 | String[] groups = matcher.group().strip().split("\\^\\^"); //변수명, [1, 2] 33 | String variableName = groups[0].trim(); //변수명 34 | String list = groups[1].trim(); //리스트 35 | String uuid = line.replaceFirst(patternText, "").strip(); 36 | VariableType variableType = VariableCheck.checkVariableType(variableName); 37 | if (!VariableCheck.checkList(variableType, list)) 38 | throw new VariableException(VariableMessage.typeMatchError); 39 | cut(list, variableName, uuid); 40 | } 41 | } 42 | 43 | //value : [1, 2] 44 | private void cut(String value, String var, String uuid) { 45 | if (!Repository.uuidMap.containsKey(uuid)) throw new MatchException(MatchMessage.grammarError); 46 | String total = Repository.uuidMap.get(uuid); 47 | //1, 2, 3, ... 48 | String[] values = value.trim().substring(1, value.length()-1).split(","); 49 | for (String vs : values) { 50 | VariableCheck.setValue(var, vs.trim()); 51 | for (String l : total.split("\\n")) { 52 | BreakContinue breakContinue = settingStart(l); 53 | if (breakContinue.equals(BreakContinue.Break)) return; 54 | if (breakContinue.equals(BreakContinue.Continue)) break; 55 | } 56 | } 57 | } 58 | 59 | @Override 60 | public String getPattern() { 61 | return patternText; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/origin/loop/controller/For.java: -------------------------------------------------------------------------------- 1 | package origin.loop.controller; 2 | 3 | import event.Setting; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.loop.model.LoopWork; 7 | import origin.variable.model.Repository; 8 | 9 | import java.util.Arrays; 10 | import java.util.List; 11 | import java.util.Objects; 12 | import java.util.regex.Pattern; 13 | 14 | public class For implements LoopWork, Repository { 15 | //[숫자]^[숫자]^[숫자] 16 | private static final String patternText = "(\\n|^\\s*)[\\d\\-.]+\\^[\\d\\-.]+\\^[\\d\\-.]+(\\s*|$)"; 17 | private static final Pattern pattern = Pattern.compile(patternText); 18 | 19 | @Override 20 | public boolean check(String line) { 21 | return pattern.matcher(line).find(); 22 | } 23 | 24 | @Override 25 | public void start(String line) { 26 | List list = Arrays.stream(line.strip().split(" ")) 27 | .filter(Objects::nonNull) 28 | .filter(v -> !v.isEmpty()) 29 | .toList(); 30 | 31 | String key = list.get(1); 32 | if (!uuidMap.containsKey(key) || list.size() != 2) throw new MatchException(MatchMessage.grammarError); 33 | //괄호 제거 작업 34 | String value = uuidMap.get(key).substring(1, uuidMap.get(key).length()-1).strip(); 35 | 36 | List numbers = Arrays.stream(list.get(0).split("\\^")) 37 | .mapToDouble(Double::parseDouble) 38 | .boxed() 39 | .toList(); 40 | 41 | double first = numbers.get(0); 42 | double second = numbers.get(1); 43 | double third = numbers.get(2); 44 | 45 | if (third < 0) { 46 | for (double d = first; d > second; d += third) { 47 | for (String l : value.split("\\n")) { 48 | BreakContinue breakContinue = settingStart(l); 49 | if (breakContinue.equals(BreakContinue.Break)) return; 50 | if (breakContinue.equals(BreakContinue.Continue)) break; 51 | } 52 | } 53 | } else if (third > 0){ 54 | for (double d = first; d < second; d += third) { 55 | for (String l : value.split("\\n")) { 56 | BreakContinue breakContinue = settingStart(l); 57 | if (breakContinue.equals(BreakContinue.Break)) return; 58 | if (breakContinue.equals(BreakContinue.Continue)) break; 59 | } 60 | } 61 | } 62 | } 63 | 64 | @Override 65 | public String getPattern() { 66 | return patternText; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/custom/registration/controller/DefineCustomClass.java: -------------------------------------------------------------------------------- 1 | package custom.registration.controller; 2 | 3 | import custom.registration.define.RepositoryValue; 4 | import custom.use.controller.UseCustomClass; 5 | import custom.use.define.BracketSplit; 6 | import origin.exception.VariableException; 7 | import origin.exception.VariableMessage; 8 | import origin.variable.model.Repository; 9 | 10 | import java.util.regex.Matcher; 11 | import java.util.regex.Pattern; 12 | 13 | //커스텀 클래스 등록 14 | public class DefineCustomClass implements BracketSplit { 15 | //ㅋㅅㅋ 클래스명[ㅇㅁㅇ 변수명] uuid 16 | private final String text; //ㅋㅅㅋ 17 | private final String patternText; 18 | private final String uuidText; //ㅋㅅㅋ 클래스명[ㅇㅁㅇ 변수명] 19 | private final Pattern pattern; 20 | 21 | public DefineCustomClass(String patternText) { 22 | //builder : [ㅇㅁㅇ 변수명] 23 | StringBuilder builder = new StringBuilder("(\\[\\s*("); 24 | Repository.repository.keySet().forEach(key -> builder.append(key).append("|")); 25 | builder.deleteCharAt(builder.length()-1); 26 | builder.append(")\\s+[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+\\s*])+"); 27 | //[ㅇㅁㅇ 변수명] 28 | this.patternText = builder.toString(); 29 | // ㅋㅅㅋ 클래스명[ㅇㅁㅇ 변수명] 30 | this.uuidText = "^\\s*" + patternText + "\\s+[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+" + this.patternText; 31 | this.pattern = Pattern.compile(this.uuidText); 32 | this.text = patternText; 33 | } 34 | 35 | public boolean check(String line) { 36 | return pattern.matcher(line).find(); 37 | } 38 | 39 | public void start(String line) { 40 | Matcher matcher = pattern.matcher(line); 41 | if (matcher.find()) { 42 | String group = matcher.group().strip(); //ㅋㅅㅋ 클래스명[ㅇㅁㅇ 변수명] 43 | RepositoryValue variables = getRepositoryValue(group, patternText); //변수타입, 변수명 44 | String className = group //클래스명 추출 45 | .replaceFirst(patternText, "") 46 | .replaceFirst("^\\s*"+this.text+"\\s*", "") 47 | .strip(); 48 | 49 | if (Repository.classNames.contains(className)) //중복 검사 50 | throw new VariableException(className + VariableMessage.sameMethod); 51 | Repository.classNames.add(className); 52 | // uuid 추출하기 53 | String uuid = line.replaceFirst(uuidText, "").strip(); 54 | if (Repository.uuidMap.containsKey(uuid)) { 55 | String total = Repository.uuidMap.get(uuid); 56 | Repository.customClass.add(new UseCustomClass(className, variables, total)); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/origin/variable/controller/SetVariable.java: -------------------------------------------------------------------------------- 1 | package origin.variable.controller; 2 | 3 | import event.list.ListSetting; 4 | import http.items.HttpRepository; 5 | import origin.exception.MatchException; 6 | import origin.exception.MatchMessage; 7 | import origin.exception.VariableException; 8 | import origin.exception.VariableMessage; 9 | import origin.variable.define.VariableCheck; 10 | import origin.variable.define.VariableKind; 11 | 12 | import java.util.List; 13 | import java.util.Map; 14 | import java.util.Set; 15 | import java.util.regex.Matcher; 16 | import java.util.regex.Pattern; 17 | 18 | //변수에 값을 넣는 작업 19 | public class SetVariable { 20 | private final String patternText = "^\\s*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+:"; 21 | private final Pattern pattern = Pattern.compile(patternText); 22 | 23 | public boolean check(String line) { 24 | Pattern pattern = Pattern.compile(patternText + "[^:]+"); 25 | return pattern.matcher(line).find(); 26 | } 27 | 28 | public void start(String line, 29 | Map> repository, 30 | Set set) { 31 | Matcher matcher = pattern.matcher(line); 32 | if (matcher.find()) { 33 | String originValue = matcher.group().strip(); //변수명: 34 | String key = originValue.substring(0, originValue.length()-1); //변수명: => 변수명 35 | String value = line.replaceFirst(patternText, ""); //변수에 들어갈 값 36 | //리스트인지 변수인지 확인하는 로직 37 | VariableKind variableKind = VariableCheck.checkVariableKind(VariableCheck.getCheck(key)); 38 | if (!set.contains(key)) throw new VariableException(key + VariableMessage.doNotFind); 39 | if (variableKind.equals(VariableKind.LIST)) { 40 | // <<변수에 들어갈 값 41 | if (!value.startsWith("<<")) throw new MatchException(MatchMessage.grammarError); 42 | value = value.replaceFirst("^<<", ""); //변수에 들어갈 값 43 | for (String keys : repository.keySet()) { 44 | if (repository.get(keys).containsKey(key)) { 45 | List list = (List) repository.get(keys).get(key); 46 | ListSetting.checkList(list, value, keys); 47 | return; 48 | } 49 | } 50 | } else { 51 | if (HttpRepository.partMap.containsKey(key)) HttpRepository.partMap.put(key, value); 52 | for (String keys : repository.keySet()) { 53 | if (repository.get(keys).containsKey(key)) 54 | repository.get(keys).put(key, value.strip()); //변수명:값 => 값을 넣는 작업 55 | } 56 | } 57 | 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/custom/tool/CustomSetVariable.java: -------------------------------------------------------------------------------- 1 | package custom.tool; 2 | 3 | import event.Controller; 4 | 5 | import java.util.Map; 6 | import java.util.Set; 7 | import java.util.regex.Matcher; 8 | import java.util.regex.Pattern; 9 | 10 | public class CustomSetVariable { 11 | private final String countPattern = "^~*"; 12 | private final String patternText = "^\\s*~*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+:"; 13 | private final Pattern pattern = Pattern.compile(patternText); 14 | 15 | public boolean check(String line) { 16 | return pattern.matcher(line).find(); 17 | } 18 | 19 | public void start(String line, 20 | Map> repository1, 21 | Map> repository2, 22 | Map> repository3, 23 | Set set1, 24 | Set set2, 25 | Set set3) { 26 | Matcher matcher = pattern.matcher(line); 27 | if (matcher.find()) { 28 | String group = matcher.group().strip(); //~~변수명: 29 | int count = getCount(group); //~ 갯수 30 | String variableName = getVariableName(line); //변수명:넣을 값 31 | var repository = switch (count) { 32 | case 0 -> repository1; 33 | case 1 -> repository2; 34 | default -> repository3; 35 | }; 36 | var set = switch (count) { 37 | case 0 -> set1; 38 | case 1 -> set2; 39 | default -> set3; 40 | }; 41 | Controller.setVariable.start(variableName, repository, set); 42 | } 43 | } 44 | 45 | public void start(String line, 46 | Map> repository1, 47 | Map> repository2, 48 | Set set1, 49 | Set set2) { 50 | Matcher matcher = pattern.matcher(line); 51 | if (matcher.find()) { 52 | String group = matcher.group().strip(); //~~변수명: 53 | int count = getCount(group); //~ 갯수 54 | String variableName = getVariableName(line); //변수명:넣을 값 55 | var repository = count==0 ? repository1 : repository2; 56 | var set = count==0 ? set1 : set2; 57 | Controller.setVariable.start(variableName, repository, set); 58 | } 59 | } 60 | 61 | // ~ 갯수 반환 62 | private int getCount(String group) { 63 | Matcher countMatcher = Pattern.compile(countPattern).matcher(group); 64 | if (countMatcher.find()) return countMatcher.group().length(); //~~ 갯수 반환 65 | return 0; 66 | } 67 | 68 | // ~~변수명:넣을 값 => 변수명:넣을값 69 | private String getVariableName(String group) { 70 | return group.replaceFirst(countPattern, ""); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/etc/reader/infor/otl/sing.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "더하기 (+)", 4 | "rescue": "ㅇ+ㅇ", 5 | "grammar": "<숫자> ㅇ+ㅇ <숫자>", 6 | "version": "1.0.0", 7 | "explanation": "숫자를 더하는 동작을 합니다.", 8 | "example": "ㅆㅁㅆ 1 ㅇ+ㅇ 1", 9 | "print": "2" 10 | }, 11 | { 12 | "name": "빼기 (-)", 13 | "rescue": "ㅇ-ㅇ", 14 | "grammar": "<숫자> ㅇ-ㅇ <숫자>", 15 | "version": "1.0.0", 16 | "explanation": "숫자를 빼는 동작을 합니다.", 17 | "example": "ㅆㅁㅆ 1 ㅇ-ㅇ 1", 18 | "print": "0" 19 | }, 20 | { 21 | "name": "나누기 (/)", 22 | "rescue": "ㅇ/ㅇ", 23 | "grammar": "<숫자> ㅇ/ㅇ <숫자>", 24 | "version": "1.0.0", 25 | "explanation": "숫자를 나누는 동작을 합니다.", 26 | "example": "ㅆㅁㅆ 4 ㅇ/ㅇ 2", 27 | "print": "2" 28 | }, 29 | { 30 | "name": "곱하기 (*)", 31 | "rescue": "ㅇ*ㅇ", 32 | "grammar": "<숫자> ㅇ*ㅇ <숫자>", 33 | "version": "1.0.0", 34 | "explanation": "숫자를 곱하는 동작을 합니다.", 35 | "example": "ㅆㅁㅆ 1 ㅇ*ㅇ 1", 36 | "print": "1" 37 | }, 38 | { 39 | "name": "나머지 (%)", 40 | "rescue": "ㅇ%ㅇ", 41 | "grammar": "<숫자> ㅇ%ㅇ <숫자>", 42 | "version": "1.0.0", 43 | "explanation": "숫자의 나머지를 구하는 동작을 합니다.", 44 | "example": "ㅆㅁㅆ 5 ㅇ%ㅇ 2", 45 | "print": "3" 46 | }, 47 | { 48 | "name": "보다 작을때 (>)", 49 | "rescue": "ㅇ>ㅇ", 50 | "grammar": "<숫자> ㅇ>ㅇ <숫자>", 51 | "version": "1.0.0", 52 | "explanation": "숫자의 대소비교를 합니다. 블린형으로 반환을 합니다.", 53 | "example": "ㅆㅁㅆ 2 ㅇ>ㅇ 1", 54 | "print": "ㅇㅇ" 55 | }, 56 | { 57 | "name": "보다 클때 (<)", 58 | "rescue": "ㅇ<ㅇ", 59 | "grammar": "<숫자> ㅇ<ㅇ <숫자>", 60 | "version": "1.0.0", 61 | "explanation": "숫자의 대소비교를 합니다. 블린형으로 반환을 합니다.", 62 | "example": "ㅆㅁㅆ 1 ㅇ<ㅇ 2", 63 | "print": "ㅇㅇ" 64 | }, 65 | { 66 | "name": "참 (true)", 67 | "rescue": "ㅇㅇ", 68 | "grammar": "ㅇㅇ", 69 | "version": "1.0.0", 70 | "explanation": "참을 의미합니다.", 71 | "example": "?ㅅ? ㅇㅇ {...}", 72 | "print": "" 73 | }, 74 | { 75 | "name": "거짓 (false)", 76 | "rescue": "ㄴㄴ", 77 | "grammar": "ㄴㄴ", 78 | "version": "1.0.0", 79 | "explanation": "거짓을 의미합니다.", 80 | "example": "?ㅅ? ㄴㄴ {...}", 81 | "print": "" 82 | }, 83 | { 84 | "name": "또는 (or)", 85 | "rescue": "ㄸ", 86 | "grammar": "ㄸ", 87 | "version": "1.0.0", 88 | "explanation": "OR 연산자를 의미합니다.", 89 | "example": "?ㅅ? ㅇㅇ ㄸ ㅇㅇ {...}", 90 | "print": "" 91 | }, 92 | { 93 | "name": "그리고 (and)", 94 | "rescue": "ㄲ", 95 | "grammar": "ㄲ", 96 | "version": "1.0.0", 97 | "explanation": "AND 연산자를 의미합니다.", 98 | "example": "?ㅅ? ㅇㅇ ㄲ ㅇㅇ {...}", 99 | "print": "" 100 | }, 101 | { 102 | "name": "부정 (not)", 103 | "rescue": "ㅇㄴ", 104 | "grammar": "ㅇㄴ", 105 | "version": "1.0.0", 106 | "explanation": "NOT 연산자를 의미합니다.", 107 | "example": "?ㅅ? ㅇㄴㅇㅇ {...}", 108 | "print": "" 109 | } 110 | ] -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /src/main/java/custom/tool/CustomGetVariable.java: -------------------------------------------------------------------------------- 1 | package custom.tool; 2 | 3 | import java.util.Map; 4 | import java.util.regex.Matcher; 5 | import java.util.regex.Pattern; 6 | 7 | public class CustomGetVariable { 8 | private final String countPattern = "^~*"; 9 | private final String patternText = ":~*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+[ _]"; 10 | private final Pattern pattern = Pattern.compile(patternText); 11 | 12 | public boolean check(String line) { 13 | return pattern.matcher(line).find(); 14 | } 15 | 16 | public String start(String line, 17 | Map> repository1, 18 | Map> repository2, 19 | Map> repository3) { 20 | Matcher matcher = pattern.matcher(line); 21 | while (matcher.find()) { 22 | String group = matcher.group(); //:~변수명_ 23 | int count = getCount(group);//~ 갯수 24 | String variableName = getVariableName(group); //변수명 25 | var repository = switch (count) { 26 | case 0 -> repository1; 27 | case 1 -> repository2; 28 | default -> repository3; 29 | }; 30 | line = getVariable(line, variableName, repository); 31 | } 32 | return line; 33 | } 34 | 35 | //클래스 레벨 저장소 36 | public String start(String line, 37 | Map> repository1, 38 | Map> repository2) { 39 | Matcher matcher = pattern.matcher(line); //:~~변수명_ 40 | while (matcher.find()) { 41 | String group = matcher.group(); 42 | int count = getCount(group); //~ 갯수 43 | String variableName = getVariableName(group); //변수명 44 | var repository = count==0 ? repository1 : repository2; 45 | line = getVariable(line, variableName, repository); 46 | } 47 | return line; 48 | } 49 | 50 | // ~ 개수 구하기 // :~~변수명_ 51 | private int getCount(String group) { 52 | group = group.substring(1, group.length()-1); //:~~변수명_ => ~~변수명 53 | Matcher countMatcher = Pattern.compile(countPattern).matcher(group); 54 | if (countMatcher.find()) return countMatcher.group().length(); //~~ 갯수 반환 55 | return 0; 56 | } 57 | 58 | // 변수명 구하기 // :~~변수명_ 59 | private String getVariableName(String group) { 60 | group = group.substring(1, group.length()-1); //:~~변수명_ => ~~변수명 61 | return group.replaceFirst(countPattern, ""); // ~~변수명 => 변수명 62 | } 63 | 64 | // line : 변경 라인 65 | // key : 변수명 66 | private String getVariable(String line, String key, 67 | Map> repository) { 68 | for (String keys : repository.keySet()) { 69 | if (repository.get(keys).containsKey(key)) 70 | line = line.replaceFirst(patternText, repository.get(keys).get(key).toString()); 71 | } 72 | return line; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/math/controller/NumberCalculation.java: -------------------------------------------------------------------------------- 1 | package math.controller; 2 | 3 | import math.model.CalculationWork; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.variable.model.Repository; 7 | 8 | import java.util.Stack; 9 | import java.util.regex.Matcher; 10 | import java.util.regex.Pattern; 11 | 12 | public class NumberCalculation implements CalculationWork { 13 | 14 | private final String PATTERN = "-?\\d+\\.?\\d*\\s*(ㅇ<ㅇ|ㅇ>ㅇ|ㅇ=ㅇ|ㅇ<=ㅇ|ㅇ>=ㅇ)\\s*-?\\d+\\.?\\d*"; 15 | private final String singText = "ㅇ<ㅇ|ㅇ>ㅇ|ㅇ=ㅇ|ㅇ<=ㅇ|ㅇ>=ㅇ"; 16 | private final String numberText = "-?\\d+\\.?\\d*"; 17 | private final Pattern pattern = Pattern.compile(PATTERN); 18 | private final Pattern singPattern = Pattern.compile(singText); 19 | private final Pattern numberPattern = Pattern.compile(numberText); 20 | private final static char left = '('; 21 | private final static char right = ')'; 22 | 23 | @Override 24 | public String start(String line) { 25 | return stack(line); 26 | } 27 | 28 | //숫자 기호 숫자 형태의 모양이 없어질때까지 라인 스캔 29 | private String comparison(String line) { 30 | Matcher matcher = pattern.matcher(line); 31 | while (matcher.find()) { 32 | String value = matcher.group(); 33 | Matcher singMatcher = singPattern.matcher(value); 34 | Matcher numberMatcher = numberPattern.matcher(value); 35 | String number1 = numberMatcher.group(0); 36 | String number2 = numberMatcher.group(1); 37 | String sing = singMatcher.group(); 38 | line = line.replaceFirst(value, check(number1, number2, sing)?"ㅇㅇ":"ㄴㄴ"); 39 | } 40 | return line; 41 | } 42 | 43 | private boolean check(String num1, String num2, String sing) { 44 | double number1 = Double.parseDouble(num1); 45 | double number2 = Double.parseDouble(num2); 46 | return switch (sing) { 47 | case "ㅇ>ㅇ" -> number1 > number2; 48 | case "ㅇ<ㅇ" -> number1 < number2; 49 | case "ㅇ=ㅇ" -> number1 == number2; 50 | case "ㅇ>=ㅇ" -> number1 >= number2; 51 | case "ㅇ<=ㅇ" -> number1 <= number2; 52 | default -> throw new MatchException(MatchMessage.grammarError); 53 | }; 54 | } 55 | 56 | //괄호가 있으면 괄호가 있으면 괄호를 먼저 계산함 57 | private String stack(String line) { 58 | Stack stack = new Stack<>(); 59 | for (int i = 0; iㅇ25) 65 | String numbers = line.substring(start, i+1); 66 | line = line.replaceFirst(numbers, comparison(line)); 67 | i = start; 68 | } 69 | } 70 | return comparison(line); 71 | } 72 | 73 | @Override 74 | public boolean check(String line) { 75 | return pattern.matcher(line).find(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/http/items/HttpRepository.java: -------------------------------------------------------------------------------- 1 | package http.items; 2 | 3 | import http.define.HttpMethodType; 4 | 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | public interface HttpRepository { 11 | String dateFormat = "yyyy-MM-dd H:mm:ss"; 12 | Map partMap = new HashMap<>(); //http 에 출력될 변수 13 | Map pathMap = new HashMap<>(); //url, html 경로 14 | Map POST = new HashMap<>(); //post 로 받은 값 저장 15 | Map GET = new HashMap<>(); //get 으로 받은 값 저장 16 | 17 | static void startSetting() { 18 | System.out.printf( 19 | """ 20 | %s╭───────────╮╭──╮╭────────╮╭──────────╮╭─────────╮%s 21 | %s│ ╭─────╮ │╰──╯│ ╭─────╯│ ╭────╮ ││ ╭───╮ │%s 22 | %s│ ╰─────╯ │╭──╮│ ╰─────╮│ │ │ ││ │ │ │%s 23 | %s│ ┌────────╯│ │╰─────╮ ││ │ │ ││ │ │ │%s 24 | %s│ │ ╭──────╮│ │╭─────╯ ││ ╰────╯ ││ │ │ │%s 25 | %s│ │ │ ╭──╮ ││ │╰────────╯╰──────────╯╰──╯ ╰──╯%s 26 | %s│ │ │ ╰──╯ ││ │%s %s== OTLanguage ==%s 27 | %s╰──╯ ╰──────╯╰──╯%s %s== Poison ==%s 28 | 29 | """, 30 | Color.PURPLE_BRIGHT, Color.RESET, 31 | Color.PURPLE_BRIGHT, Color.RESET, 32 | Color.PURPLE_BRIGHT, Color.RESET, 33 | Color.PURPLE_BRIGHT, Color.RESET, 34 | Color.PURPLE_BRIGHT, Color.RESET, 35 | Color.PURPLE_BRIGHT, Color.RESET, 36 | Color.PURPLE_BRIGHT, Color.RESET, 37 | Color.PURPLE, Color.RESET, 38 | Color.PURPLE_BRIGHT, Color.RESET, 39 | Color.PURPLE, Color.RESET); 40 | 41 | System.out.printf("%s[%s]%s%s[Poison Server 시작]%s ", 42 | Color.YELLOW, 43 | new SimpleDateFormat(dateFormat).format(new Date()), 44 | Color.RESET, Color.GREEN, Color.RESET); 45 | 46 | Runtime.getRuntime().addShutdownHook(new Thread(() -> 47 | System.out.printf("%s[%s]%s%s[Poison Server 종료]%s \n", 48 | Color.YELLOW, 49 | new SimpleDateFormat(dateFormat).format(new Date()), 50 | Color.RESET, Color.GREEN, Color.RESET))); 51 | } 52 | 53 | default void printLog(HttpMethodType method, String path, String query) { 54 | //[2022-07-12 18:58:53] GET [경로] / | [값] name=hi 55 | System.out.printf("%s[%s]%s", Color.YELLOW, new SimpleDateFormat(dateFormat).format(new Date()), Color.RESET); 56 | if (method.equals(HttpMethodType.POST)) System.out.printf("%s %s %s", Color.POST_PRINT, method, Color.RESET); 57 | else System.out.printf("%s %s %s", Color.GET_PRINT, method, Color.RESET); 58 | System.out.print(" [경로] "); 59 | System.out.printf("%s %s %s",Color.QUERY_PRINT, path == null ? "" : path, Color.RESET); 60 | System.out.print(" | [값] "); 61 | System.out.printf("%s %s %s\n", Color.QUERY_PRINT, query == null ? "" : query, Color.RESET); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/system/start/keyword/KeyWordRepository.java: -------------------------------------------------------------------------------- 1 | package system.start.keyword; 2 | 3 | import event.Setting; 4 | import http.items.Color; 5 | import origin.variable.model.Repository; 6 | 7 | import java.util.Map; 8 | 9 | public interface KeyWordRepository extends Repository { 10 | String seeDefineVariable = "정의된 변수 보기"; 11 | String seeDefineClass = "정의된 클래스 보기"; 12 | String codeReset = "코드 초기화"; 13 | /** 14 | * @see event.Setting 15 | */ 16 | static void add() { 17 | // 정의된 변수 보기 18 | systemWorks.add(new SpecialKeyword(seeDefineVariable) { 19 | @Override 20 | public void start(String line) { 21 | String[] varKindKor = { 22 | "ㅇㅈㅇ", "ㅇㅉㅇ", "ㅇㅂㅇ", "ㅇㅁㅇ", "ㅇㄱㅇ", "ㅇㅅㅇ", "ㅇㅆㅇ", 23 | "ㄹㅈㄹ", "ㄹㅉㄹ", "ㄹㅂㄹ", "ㄹㅁㄹ", "ㄹㄱㄹ", "ㄹㅅㄹ", "ㄹㅆㄹ"}; 24 | String[] varKindEng = { 25 | "oio", "oIo", "obo", "oCo", "oco", "ofo", "oFo", 26 | "lil", "lIl", "lbl", "lCl", "lcl", "lfl", "lFl"}; 27 | 28 | Map> repository = Repository.repository; 29 | StringBuilder builder = new StringBuilder(Color.CYAN_BOLD); 30 | for (int i = 0; i< varKindKor.length; i++) { 31 | builder.append(varKindKor[i]).append(", ").append(varKindEng[i]); 32 | builder.append(" = ").append("["); 33 | for (String key : repository.get(varKindKor[i]).keySet()) { 34 | builder.append(key).append(" = ").append(repository.get(varKindKor[i]).get(key)); 35 | builder.append(", "); 36 | } 37 | for (String key : repository.get(varKindEng[i]).keySet()) { 38 | builder.append(key).append(" = ").append(repository.get(varKindEng[i]).get(key)); 39 | builder.append(", "); 40 | } 41 | int count = repository.get(varKindKor[i]).size() + repository.get(varKindEng[i]).size(); 42 | if (count != 0) builder.delete(builder.length()-2, builder.length()); 43 | builder.append("]").append("\n"); 44 | } 45 | builder.deleteCharAt(builder.length() - 1); 46 | builder.append(Color.RESET); 47 | System.out.println(builder); 48 | } 49 | }); 50 | 51 | systemWorks.add(new SpecialKeyword(codeReset) { 52 | @Override 53 | public void start(String line) { 54 | Setting.firstStart(); 55 | } 56 | }); 57 | 58 | systemWorks.add(new SpecialKeyword(seeDefineClass) { 59 | @Override 60 | public void start(String line) { 61 | StringBuilder builder = new StringBuilder(Color.CYAN_BOLD + "["); 62 | Repository.classNames.forEach(v -> builder.append(v).append(", ")); 63 | builder.delete(builder.length()-2, builder.length()); 64 | builder.append("]"+Color.RESET); 65 | System.out.println(builder); 66 | } 67 | }); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/Main.java: -------------------------------------------------------------------------------- 1 | import event.Setting; 2 | import http.server.Server; 3 | import origin.exception.FileFailException; 4 | import origin.exception.FileFailMessage; 5 | 6 | import java.io.*; 7 | import java.nio.charset.StandardCharsets; 8 | import java.util.Locale; 9 | import java.util.Scanner; 10 | 11 | public class Main extends Setting { 12 | 13 | public static void main(String[] args) { 14 | new Main(args); 15 | } 16 | 17 | private Main(String[] args) { 18 | Runtime.getRuntime().addShutdownHook(new Thread(() -> { 19 | if (Server.httpServerManager != null) Server.httpServerManager.stop(); 20 | System.out.println("OTLanguage 종료 됨\n"); 21 | })); 22 | firstStart(); 23 | 24 | if(args.length > 0) path = args[0]; 25 | if (args.length == 2) fileRead(path + "/" + args[1]); 26 | else { 27 | Scanner scanner = new Scanner(System.in); 28 | int stack = 0; 29 | while (true) { 30 | try { 31 | System.out.print(">>> "); 32 | String line = scanner.nextLine(); 33 | if (line.equalsIgnoreCase("exit")) break; 34 | stack += count(line, '{'); 35 | if (stack == 0) super.start(line); 36 | else if (stack > 0) { 37 | total.append(line); 38 | while (stack > 0) { 39 | Scanner sc = new Scanner(System.in); 40 | System.out.print("--- "); 41 | String t = sc.nextLine(); 42 | stack += count(t, '{'); 43 | stack -= count(t, '}'); 44 | total.append(t).append("\n"); 45 | } 46 | for (String l : bracket.bracket(total.toString().replace("{", "{\n")).split("\\n")) 47 | super.start(l); 48 | total.setLength(0); 49 | } else stack = 0; 50 | 51 | } catch (Exception e) { 52 | System.err.println("\n" + e.getMessage()); 53 | } 54 | } 55 | } 56 | } 57 | 58 | private int count(String line, char c) { 59 | int count = 0; 60 | for (int i = 0; i 고유 아이디로 전환 //괄호 계산 73 | String total = bracket.bracket(Setting.total.toString()); 74 | for (String line : total.split("\\n")) { 75 | start(line); // 실행 메소드 76 | } 77 | } catch (IOException ignored) {} 78 | pause(); 79 | } 80 | 81 | private void pause() { 82 | while (true) {} 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/custom/use/controller/UseCustomVoid.java: -------------------------------------------------------------------------------- 1 | package custom.use.controller; 2 | 3 | import custom.registration.define.RepositoryValue; 4 | import custom.use.define.BracketSplit; 5 | import event.Controller; 6 | import event.Setting; 7 | import origin.variable.model.Repository; 8 | import origin.variable.model.VariableWork; 9 | 10 | import java.util.*; 11 | import java.util.regex.Matcher; 12 | import java.util.regex.Pattern; 13 | 14 | public class UseCustomVoid implements BracketSplit { 15 | public final Map> repository = new HashMap<>(); 16 | public final Set set = new HashSet<>(); 17 | 18 | private final Map> mainRepository; 19 | private final Set mainSet; 20 | 21 | private final RepositoryValue repositoryValue; 22 | private final String patternCount; //[안녕하세요][1234] 페턴 23 | private final String methodName; 24 | 25 | private final String patternText; 26 | private final Pattern pattern; 27 | 28 | private final String total; 29 | 30 | public UseCustomVoid(String className, String methodName, String total, 31 | RepositoryValue repositoryValue, 32 | Map> mainRepository, 33 | Set mainSet) { 34 | this.total = total; 35 | this.repositoryValue = repositoryValue; 36 | this.mainRepository = mainRepository; 37 | this.mainSet = mainSet; 38 | this.methodName = methodName; 39 | 40 | int count = repositoryValue.values().size(); 41 | //클래스명~메소드명[안녕하세요][1234] 42 | this.patternText = "^\\s*" + className + "~" + methodName + "\\[[^\\[\\]]+]".repeat(count); 43 | this.patternCount = "\\[[^\\[\\]]+]".repeat(count); 44 | this.pattern = Pattern.compile(this.patternText); 45 | //저장소 새로 만들기 46 | Repository.repository.keySet().forEach(key -> repository.put(key, new HashMap<>())); 47 | } 48 | 49 | public UseCustomVoid(String methodName, String total, 50 | RepositoryValue repositoryValue, 51 | Map> mainRepository, 52 | Set mainSet) { 53 | this.total = total; 54 | this.repositoryValue = repositoryValue; 55 | this.mainRepository = mainRepository; 56 | this.mainSet = mainSet; 57 | this.methodName = methodName; 58 | 59 | int count = repositoryValue.values().size(); 60 | //메소드명[안녕하세요][1234] 61 | this.patternText = "^\\s*" + methodName + "\\[[^\\[\\]]+]".repeat(count); 62 | this.patternCount = "\\[[^\\[\\]]+]".repeat(count); 63 | this.pattern = Pattern.compile(this.patternText); 64 | //저장소 새로 만들기 65 | Repository.repository.keySet().forEach(key -> repository.put(key, new HashMap<>())); 66 | } 67 | 68 | public boolean check(String line) { 69 | return pattern.matcher(line).find(); 70 | } 71 | 72 | public void start(String line) { 73 | // [안녕하세요][1234] 74 | Matcher matcher = Pattern.compile(patternCount).matcher(line); 75 | // getVariables : [안녕하세요][1234] 76 | if (matcher.find()) getVariables(matcher.group(), repositoryValue, repository, set); //초기값 변수를 정의하는 동작 77 | 78 | Arrays.stream(this.total.split("\\n")).forEach(this::settingStart); 79 | } 80 | 81 | //실행 동작 82 | private void settingStart(String line) { 83 | start(line, repository, mainRepository, set, mainSet); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/custom/use/controller/UseCustomClass.java: -------------------------------------------------------------------------------- 1 | package custom.use.controller; 2 | 3 | import custom.registration.controller.DefineCustomMethod; 4 | import custom.registration.define.RepositoryValue; 5 | import custom.use.define.BracketSplit; 6 | import event.Controller; 7 | import event.Setting; 8 | import origin.consol.define.PriorityPrintWork; 9 | import origin.variable.model.Repository; 10 | import origin.variable.model.VariableWork; 11 | 12 | import java.util.*; 13 | import java.util.regex.Matcher; 14 | import java.util.regex.Pattern; 15 | 16 | public class UseCustomClass implements BracketSplit { 17 | public final Map> repository = new HashMap<>(); 18 | public final Set set = new HashSet<>(); 19 | public final Set methods = new HashSet<>(); //메소드명 저장 20 | //메소드 저장소 21 | public final Set useCustomStrings = new HashSet<>(); 22 | public final Set useCustomVoids = new HashSet<>(); 23 | 24 | public final String className; 25 | 26 | private final RepositoryValue repositoryValue; 27 | private final String patternText; //클래스명[안녕하세요][1234] 28 | private final String patternCount; //[안녕하세요][1234] 페턴 29 | private final Pattern pattern; 30 | private final String total; //동작 가져오기 31 | private final DefineCustomMethod defineCustomMethod; 32 | 33 | public UseCustomClass(String className, RepositoryValue repositoryValue, String total) { 34 | this.className = className; 35 | this.total = total; 36 | this.repositoryValue = repositoryValue; 37 | int count = repositoryValue.varType().size(); 38 | this.patternText = "^\\s*" + className + "\\[[^\\[\\]]+]".repeat(count); 39 | this.patternCount = "\\[[^\\[\\]]+]".repeat(count); 40 | this.pattern = Pattern.compile(this.patternText); 41 | //저장소 새로 만들기 42 | Repository.repository.keySet().forEach(key -> repository.put(key, new HashMap<>())); 43 | this.defineCustomMethod = new DefineCustomMethod("ㅁㅅㅁ", this); 44 | } 45 | 46 | public boolean check(String line) { 47 | return pattern.matcher(line).find(); 48 | } 49 | 50 | public void start(String line) { 51 | // [안녕하세요][1234] 52 | Matcher matcher = Pattern.compile(patternCount).matcher(line); 53 | // getVariables : [안녕하세요][1234] 54 | if (matcher.find()) getVariables(matcher.group(), repositoryValue, repository, set); //초기값 변수를 정의하는 동작 55 | Arrays.stream(total.split("\\n")).forEach(this::settingStart); 56 | } 57 | 58 | private void settingStart(String line) { 59 | for (var work : Repository.priorityPrintWorks) {if (work.check(line)) {work.start(line);return;}} //강제 출력 60 | line = updateBlock(line); //괄호를 푸는 동작 61 | // 변수 세팅 등을 하는 동작 62 | if (Controller.customGetVariableWork.check(line)) { //변수값 가져오기 63 | line = Controller.customGetVariableWork.start(line, repository, Repository.repository);} 64 | line = Controller.bracket.bracket(line); 65 | line = Setting.startString(line); 66 | if (this.defineCustomMethod.check(line)) {this.defineCustomMethod.start(line); return;} // 메소드 생성 67 | if (Controller.customSetVariableWork.check(line)) { //변수값 업데이트 68 | Controller.customSetVariableWork.start(line, repository, Repository.repository, set, Repository.set);return;} 69 | for (VariableWork work : Repository.variableWorks) {//변수 정의하는 동작 70 | if (work.check(line)) {work.start(line, repository, set); return;}} 71 | Setting.start(line); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/event/list/ListSetting.java: -------------------------------------------------------------------------------- 1 | package event.list; 2 | 3 | import origin.exception.IndexException; 4 | import origin.exception.IndexMessage; 5 | import origin.variable.controller.list.ListVariable; 6 | import origin.variable.define.VariableCheck; 7 | import origin.variable.model.Repository; 8 | import origin.variable.model.VariableListWork; 9 | 10 | import java.util.List; 11 | import java.util.regex.Matcher; 12 | import java.util.regex.Pattern; 13 | 14 | public interface ListSetting extends Repository { 15 | String setPattern = "^\\s*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+:<<"; // [변수명]:<<[값] 16 | String getPattern = ":[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+>>\\d+[ _]"; // :[변수명]>>index[공백] 17 | String textPattern = "^\\s*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+--\\d+"; // [변수명]--index 18 | 19 | //[값1, 값2, 값3, ...] 인지 값 인지 확인하는 메소드 20 | //var = ㄹㅁㄹ, ㄹㄱㄹ, ... 21 | static void checkList(List list, String value, String var) { 22 | if (!(var.charAt(0) == 'ㄹ' || var.charAt(0) == 'l')) return; 23 | value = value.trim(); 24 | if (value.startsWith("[") && value.endsWith("]")) { 25 | for (String v : value.substring(1, value.length()-1).split(",")) { 26 | if (VariableCheck.check(v.trim(), var)) list.add(v.trim()); 27 | } 28 | } else { 29 | if (VariableCheck.check(value, var)) list.add(value); 30 | } 31 | } 32 | 33 | //값 불러오기 34 | VariableListWork getListVariable = new ListVariable(Pattern.compile(getPattern)) { 35 | @Override 36 | public String start(String line) { 37 | // :[변수명]>>index[공백] 38 | Matcher matcher = Pattern.compile(getPattern).matcher(line); 39 | while (matcher.find()) { 40 | // :[변수명]>>index[공백] 41 | String group = matcher.group(); 42 | int pos = group.length(); 43 | String value = group.substring(1, pos-1); //[변수명]>>index 44 | var values = value.split(">>"); 45 | var type = values[0]; 46 | var position = Integer.parseInt(values[1].replaceAll("[^0-9]", "")); 47 | for (String key : repository.keySet()) { 48 | if (repository.get(key).containsKey(type)) { 49 | List list = (List) repository.get(key).get(type); 50 | line = line.replaceFirst(getPattern, list.get(position).toString()); 51 | } 52 | } 53 | } 54 | return line; 55 | } 56 | }; 57 | 58 | //값 삭제 59 | VariableListWork deleteListVariable = new ListVariable(Pattern.compile(textPattern)) { 60 | @Override 61 | public String start(String line) { 62 | // [변수명]--index[공백] 63 | Matcher matcher = Pattern.compile(textPattern).matcher(line); 64 | if (matcher.find()) { 65 | var groups = matcher.group().strip().split("--"); 66 | var variableName = groups[0]; 67 | var pos = Integer.parseInt(groups[1].replaceAll("[^0-9]", "")); 68 | 69 | for (String key : repository.keySet()) { 70 | if (repository.get(key).containsKey(variableName)) { 71 | List list = (List) repository.get(key).get(variableName); 72 | if (list.size() > pos) list.remove(pos); 73 | else throw new IndexException(IndexMessage.removeError); 74 | return null; 75 | } 76 | } 77 | } 78 | return " "; 79 | } 80 | }; 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/http/items/Color.java: -------------------------------------------------------------------------------- 1 | package http.items; 2 | 3 | public interface Color { 4 | // Reset 5 | String RESET = "\033[0m"; // Text Reset 6 | 7 | String POST_PRINT = "\033[30m\033[102m"; 8 | String GET_PRINT = "\033[30m\033[106m"; 9 | // String QUERY_PRINT = "\033[30m\033[107m"; 10 | String QUERY_PRINT = "\033[1;34m"; 11 | 12 | // Regular Colors 13 | String BLACK = "\033[0;30m"; // BLACK 14 | String RED = "\033[0;31m"; // RED 15 | String GREEN = "\033[0;32m"; // GREEN 16 | String YELLOW = "\033[0;33m"; // YELLOW 17 | String BLUE = "\033[0;34m"; // BLUE 18 | String PURPLE = "\033[0;35m"; // PURPLE 19 | String CYAN = "\033[0;36m"; // CYAN 20 | String WHITE = "\033[0;37m"; // WHITE 21 | 22 | // Bold 23 | String BLACK_BOLD = "\033[1;30m"; // BLACK 24 | String RED_BOLD = "\033[1;31m"; // RED 25 | String GREEN_BOLD = "\033[1;32m"; // GREEN 26 | String YELLOW_BOLD = "\033[1;33m"; // YELLOW 27 | String BLUE_BOLD = "\033[1;34m"; // BLUE 28 | String PURPLE_BOLD = "\033[1;35m"; // PURPLE 29 | String CYAN_BOLD = "\033[1;36m"; // CYAN 30 | String WHITE_BOLD = "\033[1;37m"; // WHITE 31 | 32 | // Underline 33 | String BLACK_UNDERLINED = "\033[4;30m"; // BLACK 34 | String RED_UNDERLINED = "\033[4;31m"; // RED 35 | String GREEN_UNDERLINED = "\033[4;32m"; // GREEN 36 | String YELLOW_UNDERLINED = "\033[4;33m"; // YELLOW 37 | String BLUE_UNDERLINED = "\033[4;34m"; // BLUE 38 | String PURPLE_UNDERLINED = "\033[4;35m"; // PURPLE 39 | String CYAN_UNDERLINED = "\033[4;36m"; // CYAN 40 | String WHITE_UNDERLINED = "\033[4;37m"; // WHITE 41 | 42 | // Background 43 | String BLACK_BACKGROUND = "\033[40m"; // BLACK 44 | String RED_BACKGROUND = "\033[41m"; // RED 45 | String GREEN_BACKGROUND = "\033[42m"; // GREEN 46 | String YELLOW_BACKGROUND = "\033[43m"; // YELLOW 47 | String BLUE_BACKGROUND = "\033[44m"; // BLUE 48 | String PURPLE_BACKGROUND = "\033[45m"; // PURPLE 49 | String CYAN_BACKGROUND = "\033[46m"; // CYAN 50 | String WHITE_BACKGROUND = "\033[47m"; // WHITE 51 | 52 | // High Intensity 53 | String BLACK_BRIGHT = "\033[0;90m"; // BLACK 54 | String RED_BRIGHT = "\033[0;91m"; // RED 55 | String GREEN_BRIGHT = "\033[0;92m"; // GREEN 56 | String YELLOW_BRIGHT = "\033[0;93m"; // YELLOW 57 | String BLUE_BRIGHT = "\033[0;94m"; // BLUE 58 | String PURPLE_BRIGHT = "\033[0;95m"; // PURPLE 59 | String CYAN_BRIGHT = "\033[0;96m"; // CYAN 60 | String WHITE_BRIGHT = "\033[0;97m"; // WHITE 61 | 62 | // Bold High Intensity 63 | String BLACK_BOLD_BRIGHT = "\033[1;90m"; // BLACK 64 | String RED_BOLD_BRIGHT = "\033[1;91m"; // RED 65 | String GREEN_BOLD_BRIGHT = "\033[1;92m"; // GREEN 66 | String YELLOW_BOLD_BRIGHT = "\033[1;93m";// YELLOW 67 | String BLUE_BOLD_BRIGHT = "\033[1;94m"; // BLUE 68 | String PURPLE_BOLD_BRIGHT = "\033[1;95m";// PURPLE 69 | String CYAN_BOLD_BRIGHT = "\033[1;96m"; // CYAN 70 | String WHITE_BOLD_BRIGHT = "\033[1;97m"; // WHITE 71 | 72 | // High Intensity backgrounds 73 | String BLACK_BACKGROUND_BRIGHT = "\033[0;100m";// BLACK 74 | String RED_BACKGROUND_BRIGHT = "\033[0;101m";// RED 75 | String GREEN_BACKGROUND_BRIGHT = "\033[0;102m";// GREEN 76 | String YELLOW_BACKGROUND_BRIGHT = "\033[0;103m";// YELLOW 77 | String BLUE_BACKGROUND_BRIGHT = "\033[0;104m";// BLUE 78 | String PURPLE_BACKGROUND_BRIGHT = "\033[0;105m"; // PURPLE 79 | String CYAN_BACKGROUND_BRIGHT = "\033[0;106m"; // CYAN 80 | String WHITE_BACKGROUND_BRIGHT = "\033[0;107m"; // WHITE 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/origin/loop/controller/ForEach.java: -------------------------------------------------------------------------------- 1 | package origin.loop.controller; 2 | 3 | import event.Setting; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.exception.VariableException; 7 | import origin.exception.VariableMessage; 8 | import origin.loop.model.LoopWork; 9 | import origin.variable.define.VariableCheck; 10 | import origin.variable.model.Repository; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | import java.util.Objects; 15 | import java.util.regex.Matcher; 16 | import java.util.regex.Pattern; 17 | 18 | public class ForEach implements LoopWork { 19 | //단일 변수^^리스트 변수 {...} 20 | private final String patternText = "^\\s*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+\\^\\^([ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+)"; 21 | private final Pattern pattern = Pattern.compile(patternText); 22 | 23 | @Override 24 | public boolean check(String line) { 25 | return pattern.matcher(line).find(); 26 | } 27 | 28 | @Override 29 | public void start(String line) { 30 | Matcher matcher = pattern.matcher(line); 31 | if (matcher.find()) { 32 | //괄호 아이디 분리 작업 33 | List listInKey = Arrays.stream(line.strip().split(" ")) 34 | .filter(Objects::nonNull) 35 | .filter(v -> !v.isEmpty()) 36 | .toList(); 37 | String key = listInKey.get(1); 38 | if (!Repository.uuidMap.containsKey(key) || listInKey.size() != 2) throw new MatchException(MatchMessage.grammarError); 39 | 40 | //변수 분리 작업 41 | //변수1, 변수2 42 | var groups = matcher.group().strip().split("\\^\\^"); 43 | var variable1 = groups[0]; //넣을 값 44 | var variable2 = groups[1]; //리스트 변수 45 | if (!VariableCheck.check(variable1, variable2)) throw new VariableException(VariableMessage.noHaveVarName); 46 | if (!VariableCheck.check(variable2)) throw new VariableException(VariableMessage.noHaveVarName); 47 | //2개 타입 일치 확인 48 | char c1 = getCheck(variable1).charAt(1); 49 | char c2 = getCheck(variable2).charAt(1); 50 | if (c1 != c2) throw new VariableException(VariableMessage.typeMatchError); 51 | //2개 list, 변수 일치 확인 52 | c1 = VariableCheck.getCheck(variable1).charAt(0); 53 | c2 = VariableCheck.getCheck(variable2).charAt(0); 54 | if (!(c1 == 'ㅇ' || c1 == 'o')) throw new VariableException(VariableMessage.typeMatchError); 55 | if (!(c2 == 'ㄹ' || c2 == 'l')) throw new VariableException(VariableMessage.typeMatchError); 56 | 57 | var list = VariableCheck.getArray(variable2); 58 | if (list == null) throw new VariableException(variable2 + VariableMessage.doNotFind); 59 | 60 | String value = Repository.uuidMap.get(key).substring(1, Repository.uuidMap.get(key).length()-1).strip(); 61 | for (Object ob : list) { 62 | VariableCheck.setValue(variable1, ob); 63 | for (String l : value.split("\\n")) { 64 | BreakContinue breakContinue = settingStart(l); 65 | if (breakContinue.equals(BreakContinue.Break)) return; 66 | if (breakContinue.equals(BreakContinue.Continue)) break; 67 | } 68 | } 69 | } 70 | } 71 | 72 | @Override 73 | public String getPattern() { 74 | return patternText; 75 | } 76 | 77 | static String getCheck(String varName) { 78 | for (String key : Repository.repository.keySet()) { 79 | if (Repository.repository.get(key).containsKey(varName)) return key; 80 | } 81 | return " "; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/origin/loop/define/Bracket.java: -------------------------------------------------------------------------------- 1 | package origin.loop.define; 2 | 3 | import org.apache.hadoop.yarn.webapp.hamlet.Hamlet; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.loop.model.LoopWork; 7 | import origin.variable.model.Repository; 8 | 9 | import java.util.Stack; 10 | import java.util.UUID; 11 | import java.util.regex.Matcher; 12 | import java.util.regex.Pattern; 13 | 14 | public class Bracket implements Repository { 15 | 16 | private final static char left = '{'; 17 | private final static char right = '}'; 18 | 19 | private String deleteEnter(String total) { 20 | for (LoopWork loop : loopWorks) total = setMatcher(total, loop.getPattern()); 21 | return total; 22 | } 23 | 24 | //괄호가 존재하면 아이디로 대체 25 | public String bracket(String total) { 26 | Stack stack = new Stack<>(); 27 | total = deleteEnter(total); 28 | 29 | for (int i = 0; i < total.length(); i++) { 30 | if (total.charAt(i) == left) { 31 | stack.add(i); 32 | } 33 | 34 | if (total.charAt(i) == right) { 35 | if (stack.empty()) throw new MatchException(MatchMessage.matchError); 36 | String uuid = UUID.randomUUID().toString(); 37 | int start = stack.pop(); 38 | String bl = total.substring(start, i+1); 39 | 40 | total = total.replace(bl, " " + uuid.concat("\n")); 41 | total = delete(total); // uuid\n=>변수명 -> uuid=>변수명으로 변경 42 | i = start + uuid.length(); 43 | uuidMap.put(uuid, bl.strip().substring(1, bl.length()-1)); 44 | } 45 | } 46 | 47 | total = customEnterDelete(total); 48 | return ifDelete(total); 49 | } 50 | 51 | private String setMatcher(String total, String text) { 52 | String patternText = text + "\\s*\\n+\\s*\\" + left; 53 | Pattern pattern = Pattern.compile(patternText); 54 | Matcher matcher = pattern.matcher(total); 55 | 56 | //?ㅅ? 57 | Pattern p = Pattern.compile(text); 58 | while (matcher.find()) { 59 | String group = matcher.group(); 60 | Matcher m = p.matcher(group); 61 | if (m.find()) { 62 | String change = m.group().strip().concat(Character.toString(left)) + "\n"; 63 | total = total.replace(group, change); 64 | } 65 | } 66 | 67 | return total; 68 | } 69 | 70 | //uuid 가 존재하는지 체크함 71 | public boolean check(String line) { 72 | if (uuidMap.isEmpty()) return false; 73 | return uuidMap.entrySet() 74 | .stream() 75 | .anyMatch(v -> line.contains(v.getKey())); 76 | } 77 | 78 | // uuid\n=>변수명 -> uuid 변수명 79 | public String delete(String total) { 80 | String patternText = "(\\n\\s*)+=>\\s*~*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+"; 81 | Matcher matcher = Pattern.compile(patternText).matcher(total); 82 | while (matcher.find()) { 83 | String group = matcher.group().strip(); 84 | total = total.replaceFirst(patternText, group+"\n"); 85 | } 86 | return total; 87 | } 88 | 89 | // ?ㅅ? ㅇㅇ uuid ?ㅈ? ㅇㅇ uuid 90 | private String ifDelete(String total) { 91 | String patternText = "\\n+\\s*(\\?ㅈ\\?|\\?ㅉ\\?)"; 92 | Matcher matcher = Pattern.compile(patternText).matcher(total); 93 | while (matcher.find()) 94 | total = total.replaceFirst(patternText, " " + matcher.group().strip() + " "); 95 | return total; 96 | } 97 | 98 | // ((\n)) => [ ] 99 | private String customEnterDelete(String total) { 100 | return total.replaceAll("\\(\\((\\s*\\n\\s*)+\\)\\)", ""); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/java/http/controller/db/DatabaseSetting.java: -------------------------------------------------------------------------------- 1 | package http.controller.db; 2 | 3 | import http.controller.db.controller.sql.DCL; 4 | import http.controller.db.controller.sql.DDL; 5 | import http.controller.db.controller.sql.DML; 6 | import http.controller.db.define.DBType; 7 | import http.items.Color; 8 | import origin.exception.MatchException; 9 | import origin.exception.MatchMessage; 10 | 11 | import java.sql.Connection; 12 | import java.sql.DriverManager; 13 | import java.sql.SQLException; 14 | import java.util.Locale; 15 | import java.util.StringTokenizer; 16 | 17 | public class DatabaseSetting { 18 | private final static DCL dcl = new DCL(); 19 | private final static DDL ddl = new DDL(); 20 | private final static DML dml = new DML(); 21 | private static Connection con = null; 22 | private final String dbUrl; 23 | private final String user; 24 | private final String password; 25 | 26 | public DatabaseSetting(String dbKind, String dbIp, String dbPort, String dbName, String user, String password) { 27 | this.user = user; 28 | this.password = password; 29 | //sqlite, mariadb... //localhost //9090 30 | dbUrl = String.format("jdbc:%s://%s:%s/%s", dbKind, dbIp, dbPort, dbName); 31 | createConnect(); 32 | } 33 | 34 | public DatabaseSetting(String url, String user, String password) { 35 | this.user = user; 36 | this.password = password; 37 | this.dbUrl = url; 38 | createConnect(); 39 | } 40 | 41 | private void createConnect() { 42 | try { 43 | con = DriverManager.getConnection(dbUrl, user, password); 44 | } catch (SQLException e) { 45 | System.out.printf("%s디비 생성에 실패하였습니다.%s\n", Color.RED, Color.RESET); 46 | throw new MatchException(e.getMessage()); 47 | } 48 | } 49 | 50 | //데이터베이스 설정 51 | //sql = SELECT * FROM TEST 52 | public void setting(String sql) { 53 | StringTokenizer tokenizer = new StringTokenizer(sql); 54 | //commit, select, ... 55 | String kind = tokenizer.nextToken().strip().toUpperCase(Locale.ROOT); 56 | if (con == null) throw new MatchException(MatchMessage.grammarError); 57 | try { 58 | if (kind.startsWith(DBType.DCL.COMMIT.name())) dcl.commit(con); //DCL 59 | else if (kind.startsWith(DBType.DCL.ROLLBACK.name())) dcl.rollback(con); 60 | else if (kind.startsWith(DBType.DDL.ALTER.name())) ddl.alter(con, sql); //DDL 61 | else if (kind.startsWith(DBType.DDL.DROP.name())) ddl.drop(con, sql); 62 | else if (kind.startsWith(DBType.DDL.CREATE.name())) ddl.create(con, sql); 63 | else if (kind.startsWith(DBType.DML.DELETE.name())) dml.delete(con, sql); //DML 64 | else if (kind.startsWith(DBType.DML.UPDATE.name())) dml.update(con, sql); 65 | else if (kind.startsWith(DBType.DML.INSERT.name())) dml.insert(con, sql); 66 | } catch (SQLException e) { 67 | e.printStackTrace(); 68 | } 69 | } 70 | 71 | //select 문 [SELECT * FROM TEST][Value] 72 | //return = [ㅁㄴㅇㄹ, ㅁㄹㄴㅇ, ㅁㄹㅇㄴ] 73 | public String getSelectValue(String sql) { 74 | sql = sql.trim(); 75 | String[] sqlValue = sql.substring(1, sql.length()-1).split("]\\["); 76 | if (sqlValue.length != 2) throw new MatchException(MatchMessage.grammarError); 77 | try { 78 | return dml.select(con, sqlValue[0], sqlValue[1]).toString(); 79 | } catch (SQLException e) { 80 | return sql; 81 | } 82 | } 83 | 84 | public String getSelectValue(String sql, String value) { 85 | if (con == null) throw new MatchException(MatchMessage.grammarError); 86 | try { 87 | return dml.select(con, sql, value).toString(); 88 | } catch (SQLException e) { 89 | e.printStackTrace(); 90 | return sql; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/custom/registration/controller/DefineMainMethod.java: -------------------------------------------------------------------------------- 1 | package custom.registration.controller; 2 | 3 | import custom.registration.define.RepositoryValue; 4 | import custom.use.controller.UseCustomString; 5 | import custom.use.controller.UseCustomVoid; 6 | import custom.use.define.BracketSplit; 7 | import origin.exception.VariableException; 8 | import origin.exception.VariableMessage; 9 | import origin.variable.model.Repository; 10 | 11 | import java.util.regex.Matcher; 12 | import java.util.regex.Pattern; 13 | 14 | public class DefineMainMethod implements BracketSplit { 15 | private final String returnText = "=>"; 16 | //uuid=>~~메소드명 17 | private final String returnPatternText = "=>\\s*~*[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+\\s*$"; 18 | private final Pattern returnPattern = Pattern.compile(returnPatternText); 19 | private final String patternText; 20 | private final Pattern pattern; 21 | private final String uuidText; //ㅋㅅㅋ 클래스명[ㅇㅁㅇ 변수명] 22 | private final String text; //ㅁㅅㅁ 23 | 24 | public DefineMainMethod(String patternText) { 25 | //builder : [ㅇㅁㅇ 변수명] 26 | StringBuilder builder = new StringBuilder("(\\[\\s*("); 27 | Repository.repository.keySet().forEach(key -> builder.append(key).append("|")); 28 | builder.deleteCharAt(builder.length()-1); 29 | builder.append(")\\s+[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+\\s*])+"); 30 | this.patternText = builder.toString(); //[ㅇㅁㅇ 변수명] 31 | // ㅁㅅㅁ 변수명[ㅇㅁㅇ 변수명] 32 | this.uuidText = "^\\s*" + patternText + "\\s+[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9_-]+" + this.patternText; 33 | this.pattern = Pattern.compile(this.uuidText); 34 | this.text = patternText; // ㅁㅅㅁ 35 | } 36 | 37 | public boolean check(String line) { 38 | return pattern.matcher(line).find(); 39 | } 40 | 41 | public void start(String line) { 42 | Matcher matcher = this.pattern.matcher(line); // ㅁㅅㅁ 메소드명[ㅇㅁㅇ 변수명] 43 | if (matcher.find()) { 44 | String group = matcher.group().strip(); //ㅁㅅㅁ 메소드명[ㅇㅁㅇ 변수명] 45 | RepositoryValue variables = getRepositoryValue(group, patternText); //변수타입, 변수명 46 | String methodName = group //메소드명 추출 47 | .replaceFirst(patternText, "") 48 | .replaceFirst("^\\s*"+this.text+"\\s*", "") 49 | .strip(); 50 | 51 | if (Repository.methods.contains(methodName)) //중복 검사 52 | throw new VariableException(methodName + VariableMessage.sameMethod); 53 | Repository.methods.add(methodName); 54 | // uuid 추출하기 55 | String uuid = line.replaceFirst(uuidText, "").strip(); // uuid => 변수명 56 | returnValue(uuid, methodName, variables); 57 | } 58 | } 59 | 60 | private void returnValue(String line, String methodName, RepositoryValue repositoryValue) { 61 | var mainRepository = Repository.repository; 62 | var mainSet = Repository.set; 63 | //uuid=>~~메소드명 64 | Matcher matcher = returnPattern.matcher(line); 65 | if (matcher.find()) { 66 | //=>~~메소드명 -> ~~메소드명 67 | String group = matcher.group().replaceFirst(returnText, "").strip(); 68 | String uuid = line.replaceFirst(returnPatternText, "").strip(); //uuid 69 | if (Repository.uuidMap.containsKey(uuid)) { 70 | String total = Repository.uuidMap.get(uuid); 71 | Repository.useCustomStrings.add( 72 | new UseCustomString(methodName, total, repositoryValue, mainRepository, mainSet, group)); 73 | } 74 | } else { 75 | String uuid = line.strip(); 76 | if (Repository.uuidMap.containsKey(uuid)) { 77 | String total = Repository.uuidMap.get(uuid); 78 | Repository.useCustomVoids.add( 79 | new UseCustomVoid(methodName, total, repositoryValue, mainRepository, mainSet)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/custom/use/controller/UseCustomString.java: -------------------------------------------------------------------------------- 1 | package custom.use.controller; 2 | 3 | import custom.registration.define.RepositoryValue; 4 | import custom.use.define.BracketSplit; 5 | import event.Controller; 6 | import origin.variable.model.Repository; 7 | 8 | import java.util.*; 9 | import java.util.regex.Matcher; 10 | import java.util.regex.Pattern; 11 | 12 | public class UseCustomString implements BracketSplit { 13 | public final Map> repository = new HashMap<>(); 14 | public final Set set = new HashSet<>(); 15 | 16 | private final Map> mainRepository; 17 | private final Set mainSet; 18 | 19 | private final RepositoryValue repositoryValue; 20 | private final String returnValue; //리턴하는 메소드명 21 | private final String patternCount; //[안녕하세요][1234] 페턴 22 | private final String methodName; 23 | 24 | private final String patternText; 25 | private final Pattern pattern; 26 | 27 | private final String total; 28 | 29 | public UseCustomString(String className, String methodName, String total, 30 | RepositoryValue repositoryValue, 31 | Map> mainRepository, 32 | Set mainSet, String returnValue) { 33 | this.total = total; 34 | this.repositoryValue = repositoryValue; 35 | this.mainRepository = mainRepository; 36 | this.mainSet = mainSet; 37 | this.methodName = methodName; 38 | this.returnValue = returnValue; 39 | 40 | int count = repositoryValue.varType().size(); 41 | //:클래스명~메소드명[안녕하세요][1234](_ ) 42 | this.patternText = ":" + className + "~" + methodName + "\\[[^\\[\\]]+]".repeat(count) + "[_ ]"; 43 | this.patternCount = "\\[[^\\[\\]]+]".repeat(count); 44 | this.pattern = Pattern.compile(this.patternText); 45 | //저장소 새로 만들기 46 | Repository.repository.keySet().forEach(key -> repository.put(key, new HashMap<>())); 47 | } 48 | 49 | public UseCustomString(String methodName, String total, 50 | RepositoryValue repositoryValue, 51 | Map> mainRepository, 52 | Set mainSet, String returnValue) { 53 | this.total = total; 54 | this.repositoryValue = repositoryValue; 55 | this.mainRepository = mainRepository; 56 | this.mainSet = mainSet; 57 | this.methodName = methodName; 58 | this.returnValue = returnValue; 59 | 60 | int count = repositoryValue.varType().size(); 61 | //:메소드명[안녕하세요][1234](_ ) 62 | this.patternText = ":" + methodName + "\\[[^\\[\\]]+]".repeat(count) + "[_ ]"; 63 | this.patternCount = "\\[[^\\[\\]]+]".repeat(count); 64 | this.pattern = Pattern.compile(this.patternText); 65 | //저장소 새로 만들기 66 | Repository.repository.keySet().forEach(key -> repository.put(key, new HashMap<>())); 67 | } 68 | 69 | public boolean check(String line) { 70 | return pattern.matcher(line).find(); 71 | } 72 | 73 | public String start(String line) { 74 | // [안녕하세요][1234] 75 | Matcher matcher = Pattern.compile(patternCount).matcher(line); 76 | // getVariables : [안녕하세요][1234] 77 | if (matcher.find()) getVariables(matcher.group(), repositoryValue, repository, set); //초기값 변수를 정의하는 동작 78 | 79 | Arrays.stream(this.total.split("\\n")).forEach(this::settingStart); 80 | Matcher m = pattern.matcher(line); 81 | while (m.find()) { 82 | String value = Controller.customGetVariableWork.start(":"+this.returnValue+"_", 83 | repository, mainRepository, Repository.repository); //변수값 가져오기 84 | line = line.replaceFirst(this.patternText, value); 85 | } 86 | return line; 87 | } 88 | 89 | //실행 동작 90 | private void settingStart(String line) { 91 | start(line, repository, mainRepository, set, mainSet); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/math/controller/Calculation.java: -------------------------------------------------------------------------------- 1 | package math.controller; 2 | 3 | import math.model.CalculationWork; 4 | import origin.exception.MatchException; 5 | import origin.exception.MatchMessage; 6 | import origin.variable.model.Repository; 7 | 8 | import java.util.Stack; 9 | import java.util.StringTokenizer; 10 | import java.util.regex.Matcher; 11 | import java.util.regex.Pattern; 12 | 13 | public class Calculation implements CalculationWork { 14 | //숫자 기호 숫자 15 | private final String patternText = "-?\\d+\\.?\\d*\\s*(ㅇ\\+ㅇ|ㅇ-ㅇ|ㅇ\\*ㅇ|ㅇ/ㅇ|ㅇ%ㅇ)\\s*-?\\d+\\.?\\d*"; 16 | private final String singText = "ㅇ\\+ㅇ|ㅇ-ㅇ|ㅇ\\*ㅇ|ㅇ/ㅇ|ㅇ%ㅇ"; 17 | private final String numberText = "-?\\d+\\.?\\d*"; 18 | private final Pattern pattern = Pattern.compile(patternText); 19 | private final Pattern singPattern = Pattern.compile(singText); 20 | private final Pattern numberPattern = Pattern.compile(numberText); 21 | private static final char left = '('; 22 | private static final char right = ')'; 23 | 24 | //숫자 기호 숫자가 없어질때까지 반복 25 | private String account(String line) { 26 | Matcher matcher = pattern.matcher(line); 27 | while (matcher.find()) { 28 | String value = matcher.group(); 29 | Matcher singMatcher = singPattern.matcher(value); 30 | if (singMatcher.find()) { 31 | String sing = singMatcher.group(); 32 | StringTokenizer stringTokenizer = new StringTokenizer(value, sing); 33 | String number1 = stringTokenizer.nextToken().strip(); 34 | String number2 = stringTokenizer.nextToken().strip(); 35 | line = line.replace(value, check(number1, number2, sing)); 36 | } 37 | } 38 | return line; 39 | } 40 | 41 | //소수인지 정수인지 확인하고 값을 계산하는 식 42 | private String check(String num1, String num2, String sing) { 43 | if (num1.contains(".") || num2.contains(".")) { 44 | double number1 = Double.parseDouble(num1); 45 | double number2 = Double.parseDouble(num2); 46 | switch (sing) { 47 | case "ㅇ+ㅇ" : return String.valueOf(number1 + number2); 48 | case "ㅇ-ㅇ" : return String.valueOf(number1 - number2); 49 | case "ㅇ*ㅇ" : return String.valueOf(number1 * number2); 50 | case "ㅇ/ㅇ" : return String.valueOf(number1 / number2); 51 | case "ㅇ%ㅇ" : return String.valueOf(number1 % number2); 52 | default: assert false; 53 | } 54 | } else { 55 | long number1 = Long.parseLong(num1); 56 | long number2 = Long.parseLong(num2); 57 | switch (sing) { 58 | case "ㅇ+ㅇ" : return String.valueOf(number1 + number2); 59 | case "ㅇ-ㅇ" : return String.valueOf(number1 - number2); 60 | case "ㅇ*ㅇ" : return String.valueOf(number1 * number2); 61 | case "ㅇ/ㅇ" : return String.valueOf(number1 / number2); 62 | case "ㅇ%ㅇ" : return String.valueOf(number1 % number2); 63 | default: assert false; 64 | } 65 | } 66 | return "0"; 67 | } 68 | 69 | private String stack(String line) { 70 | Stack stack = new Stack<>(); 71 | for (int i = 0; i method = HttpMethodType.POST.equals(httpMethodType) ? POST : GET; 68 | Map parameters = handlerDao.parameters(); 69 | String path = handlerDao.path(); 70 | if (method.containsKey(path)) { 71 | String queryAndId = method.get(path).strip(); //[변수1:query1, 변수2:query2] id 72 | String[] queryS = queryAndId.substring(1).split("]"); 73 | if (queryS.length != 2) throw new MatchException(MatchMessage.grammarError); 74 | String[] qs = queryS[0].split(","); //[변수1:query1, 변수2:query2] 75 | String id = queryS[1].strip(); 76 | 77 | for (String q : qs) { 78 | String[] variables = q.trim().split(":"); 79 | if (variables.length != 2) throw new MatchException(MatchMessage.grammarError); 80 | String var = variables[0].trim(); 81 | Object value = parameters.get(variables[1].trim()); 82 | if (value == null) value = ""; 83 | if (VariableCheck.check(var, VariableCheck.getCheck(value.toString()))) 84 | VariableCheck.setValue(var, value); 85 | } 86 | String uuids = Repository.uuidMap.getOrDefault(id, ""); 87 | for (String line : uuids.split("\\n")) start(line); 88 | } 89 | } 90 | } 91 | --------------------------------------------------------------------------------