diff --git a/.VSCodeCounter/2024-05-14_19-40-04/details.md b/.VSCodeCounter/2024-05-14_19-40-04/details.md new file mode 100644 index 00000000..f081172c --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/details.md @@ -0,0 +1,513 @@ +# Details + +Date : 2024-05-14 19:40:04 + +Directory g:\\AST\\MCFPP + +Total : 498 files, 17106 codes, 5533 comments, 2324 blanks, all 24963 lines + +[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | +| [.idea/codeStyles/Project.xml](/.idea/codeStyles/Project.xml) | XML | 15 | 0 | 0 | 15 | +| [.idea/codeStyles/codeStyleConfig.xml](/.idea/codeStyles/codeStyleConfig.xml) | XML | 5 | 0 | 0 | 5 | +| [.idea/encodings.xml](/.idea/encodings.xml) | XML | 9 | 0 | 0 | 9 | +| [.idea/gradle.xml](/.idea/gradle.xml) | XML | 17 | 0 | 0 | 17 | +| [.idea/inspectionProfiles/Project_Default.xml](/.idea/inspectionProfiles/Project_Default.xml) | XML | 6 | 0 | 0 | 6 | +| [.idea/kotlinScripting.xml](/.idea/kotlinScripting.xml) | XML | 0 | 0 | 1 | 1 | +| [.idea/kotlinc.xml](/.idea/kotlinc.xml) | XML | 6 | 0 | 0 | 6 | +| [.idea/misc.xml](/.idea/misc.xml) | XML | 43 | 0 | 0 | 43 | +| [.idea/statistic.xml](/.idea/statistic.xml) | XML | 7 | 0 | 0 | 7 | +| [.idea/uiDesigner.xml](/.idea/uiDesigner.xml) | XML | 124 | 0 | 0 | 124 | +| [.idea/vcs.xml](/.idea/vcs.xml) | XML | 6 | 0 | 0 | 6 | +| [README.md](/README.md) | Markdown | 59 | 0 | 10 | 69 | +| [README_CN.md](/README_CN.md) | Markdown | 59 | 0 | 10 | 69 | +| [TODO.md](/TODO.md) | Markdown | 24 | 0 | 5 | 29 | +| [TODO_CN.md](/TODO_CN.md) | Markdown | 24 | 0 | 5 | 29 | +| [build.gradle.kts](/build.gradle.kts) | Kotlinscript | 82 | 0 | 14 | 96 | +| [gradle.properties](/gradle.properties) | Properties | 1 | 2 | 0 | 3 | +| [gradle/wrapper/gradle-wrapper.properties](/gradle/wrapper/gradle-wrapper.properties) | Properties | 5 | 0 | 1 | 6 | +| [gradlew.bat](/gradlew.bat) | Batch | 39 | 29 | 22 | 90 | +| [log4j2.xml](/log4j2.xml) | XML | 13 | 0 | 0 | 13 | +| [mcfpp/dynamic/mcfpp.dynamic.json](/mcfpp/dynamic/mcfpp.dynamic.json) | JSON | 8 | 0 | 0 | 8 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/append_number_index.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/append_number_index.mcfunction) | mcfunction | 1 | 2 | 1 | 4 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/join_path.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/join_path.mcfunction) | mcfunction | 6 | 5 | 2 | 13 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/z_join.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/z_join.mcfunction) | mcfunction | 1 | 2 | 0 | 3 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/everything.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/everything.mcfunction) | mcfunction | 1 | 0 | 0 | 1 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/multi.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/multi.mcfunction) | mcfunction | 1 | 0 | 0 | 1 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only.mcfunction) | mcfunction | 1 | 0 | 0 | 1 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only_with_criterion.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only_with_criterion.mcfunction) | mcfunction | 1 | 0 | 0 | 1 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get.mcfunction) | mcfunction | 1 | 0 | 0 | 1 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get_scale.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get_scale.mcfunction) | mcfunction | 1 | 0 | 0 | 1 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/modifier/add.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/modifier/add.mcfunction) | mcfunction | 0 | 0 | 1 | 1 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage.mcfunction) | mcfunction | 1 | 3 | 1 | 5 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp.mcfunction) | mcfunction | 1 | 4 | 1 | 6 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp2.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp2.mcfunction) | mcfunction | 1 | 4 | 1 | 6 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.append.from.entity_sp.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.append.from.entity_sp.mcfunction) | mcfunction | 1 | 4 | 1 | 6 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp3.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp3.mcfunction) | mcfunction | 1 | 4 | 1 | 6 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp5.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp5.mcfunction) | mcfunction | 1 | 4 | 1 | 6 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage.mcfunction) | mcfunction | 1 | 3 | 1 | 5 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp4.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp4.mcfunction) | mcfunction | 1 | 3 | 1 | 5 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp6.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp6.mcfunction) | mcfunction | 1 | 3 | 1 | 5 | +| [mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/function.mcfunction](/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/function.mcfunction) | mcfunction | 1 | 3 | 0 | 4 | +| [mcfpp/dynamic/src/DynamicCommand/pack.mcmeta](/mcfpp/dynamic/src/DynamicCommand/pack.mcmeta) | JSON | 6 | 0 | 1 | 7 | +| [mcfpp/math/mcfpp.math.json](/mcfpp/math/mcfpp.math.json) | JSON | 8 | 0 | 0 | 8 | +| [mcfpp/math/src/math/README.md](/mcfpp/math/src/math/README.md) | Markdown | 6 | 0 | 2 | 8 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls1.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls1.json) | JSON | 8 | 0 | 0 | 8 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls10.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls10.json) | JSON | 9 | 0 | 0 | 9 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls11.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls11.json) | JSON | 12 | 0 | 0 | 12 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls12.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls12.json) | JSON | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls13.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls13.json) | JSON | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls14.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls14.json) | JSON | 12 | 0 | 0 | 12 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls15.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls15.json) | JSON | 9 | 0 | 0 | 9 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls16.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls16.json) | JSON | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls2.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls2.json) | JSON | 12 | 0 | 0 | 12 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls3.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls3.json) | JSON | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls4.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls4.json) | JSON | 9 | 0 | 0 | 9 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls5.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls5.json) | JSON | 10 | 0 | 0 | 10 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls6.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls6.json) | JSON | 15 | 0 | 0 | 15 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls7.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls7.json) | JSON | 8 | 0 | 0 | 8 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls8.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls8.json) | JSON | 8 | 0 | 0 | 8 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls9.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls9.json) | JSON | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen1.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen1.json) | JSON | 17 | 0 | 0 | 17 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen2.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen2.json) | JSON | 25 | 0 | 0 | 25 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen3.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen3.json) | JSON | 26 | 0 | 0 | 26 | +| [mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen4.json](/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen4.json) | JSON | 25 | 0 | 0 | 25 | +| [mcfpp/math/src/math/data/math/functions/3vec/_coordto.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_coordto.mcfunction) | mcfunction | 4 | 5 | 1 | 10 | +| [mcfpp/math/src/math/data/math/functions/3vec/_cross.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_cross.mcfunction) | mcfunction | 20 | 1 | 2 | 23 | +| [mcfpp/math/src/math/data/math/functions/3vec/_dsp-ex.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_dsp-ex.mcfunction) | mcfunction | 2 | 4 | 1 | 7 | +| [mcfpp/math/src/math/data/math/functions/3vec/_dsp.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_dsp.mcfunction) | mcfunction | 23 | 4 | 4 | 31 | +| [mcfpp/math/src/math/data/math/functions/3vec/_ex-len.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_ex-len.mcfunction) | mcfunction | 30 | 4 | 5 | 39 | +| [mcfpp/math/src/math/data/math/functions/3vec/_ex-rot.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_ex-rot.mcfunction) | mcfunction | 27 | 10 | 6 | 43 | +| [mcfpp/math/src/math/data/math/functions/3vec/_ex-xyz.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_ex-xyz.mcfunction) | mcfunction | 30 | 8 | 4 | 42 | +| [mcfpp/math/src/math/data/math/functions/3vec/_facingto.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_facingto.mcfunction) | mcfunction | 4 | 2 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/3vec/_fposto.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_fposto.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/3vec/_get.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_get.mcfunction) | mcfunction | 6 | 1 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/3vec/_ldsp-ex.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_ldsp-ex.mcfunction) | mcfunction | 2 | 4 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/3vec/_ldsp.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_ldsp.mcfunction) | mcfunction | 22 | 4 | 3 | 29 | +| [mcfpp/math/src/math/data/math/functions/3vec/_polar.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_polar.mcfunction) | mcfunction | 27 | 14 | 7 | 48 | +| [mcfpp/math/src/math/data/math/functions/3vec/_posto.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_posto.mcfunction) | mcfunction | 6 | 4 | 1 | 11 | +| [mcfpp/math/src/math/data/math/functions/3vec/_print.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_print.mcfunction) | mcfunction | 1 | 1 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/3vec/_ssprint.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_ssprint.mcfunction) | mcfunction | 1 | 1 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/3vec/_ssrandnew.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_ssrandnew.mcfunction) | mcfunction | 8 | 1 | 0 | 9 | +| [mcfpp/math/src/math/data/math/functions/3vec/_store.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_store.mcfunction) | mcfunction | 6 | 1 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/3vec/_tofacing.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_tofacing.mcfunction) | mcfunction | 4 | 2 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/3vec/_tofpos.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_tofpos.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/3vec/_topos.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_topos.mcfunction) | mcfunction | 6 | 4 | 1 | 11 | +| [mcfpp/math/src/math/data/math/functions/3vec/_tosto.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/_tosto.mcfunction) | mcfunction | 7 | 4 | 2 | 13 | +| [mcfpp/math/src/math/data/math/functions/3vec/dsp/arrow.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/dsp/arrow.mcfunction) | mcfunction | 124 | 0 | 24 | 148 | +| [mcfpp/math/src/math/data/math/functions/3vec/dsp/loop0.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop0.mcfunction) | mcfunction | 21 | 0 | 2 | 23 | +| [mcfpp/math/src/math/data/math/functions/3vec/dsp/loop1.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop1.mcfunction) | mcfunction | 6 | 0 | 1 | 7 | +| [mcfpp/math/src/math/data/math/functions/3vec/exlen/3div.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/exlen/3div.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/3vec/exlen/range0.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/exlen/range0.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/3vec/exlen/range1.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/exlen/range1.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/3vec/exlen/range2.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/exlen/range2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/3vec/init.mcfunction](/mcfpp/math/src/math/data/math/functions/3vec/init.mcfunction) | mcfunction | 6 | 1 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/_init.mcfunction](/mcfpp/math/src/math/data/math/functions/_init.mcfunction) | mcfunction | 59 | 14 | 14 | 87 | +| [mcfpp/math/src/math/data/math/functions/_posto.mcfunction](/mcfpp/math/src/math/data/math/functions/_posto.mcfunction) | mcfunction | 3 | 4 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/_random.mcfunction](/mcfpp/math/src/math/data/math/functions/_random.mcfunction) | mcfunction | 8 | 4 | 0 | 12 | +| [mcfpp/math/src/math/data/math/functions/_refacing.mcfunction](/mcfpp/math/src/math/data/math/functions/_refacing.mcfunction) | mcfunction | 7 | 4 | 1 | 12 | +| [mcfpp/math/src/math/data/math/functions/_sincos.mcfunction](/mcfpp/math/src/math/data/math/functions/_sincos.mcfunction) | mcfunction | 4 | 5 | 0 | 9 | +| [mcfpp/math/src/math/data/math/functions/_sqrt.mcfunction](/mcfpp/math/src/math/data/math/functions/_sqrt.mcfunction) | mcfunction | 16 | 4 | 0 | 20 | +| [mcfpp/math/src/math/data/math/functions/_topos.mcfunction](/mcfpp/math/src/math/data/math/functions/_topos.mcfunction) | mcfunction | 3 | 4 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/_version.mcfunction](/mcfpp/math/src/math/data/math/functions/_version.mcfunction) | mcfunction | 2 | 2 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/_xyz.mcfunction](/mcfpp/math/src/math/data/math/functions/_xyz.mcfunction) | mcfunction | 4 | 5 | 0 | 9 | +| [mcfpp/math/src/math/data/math/functions/classify/_append.mcfunction](/mcfpp/math/src/math/data/math/functions/classify/_append.mcfunction) | mcfunction | 5 | 3 | 0 | 8 | +| [mcfpp/math/src/math/data/math/functions/classify/_ssnew.mcfunction](/mcfpp/math/src/math/data/math/functions/classify/_ssnew.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/classify/new_group.mcfunction](/mcfpp/math/src/math/data/math/functions/classify/new_group.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/classify/sloop.mcfunction](/mcfpp/math/src/math/data/math/functions/classify/sloop.mcfunction) | mcfunction | 7 | 3 | 0 | 10 | +| [mcfpp/math/src/math/data/math/functions/hpo/3div_resign.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3div_resign.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_add.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_add.mcfunction) | mcfunction | 74 | 19 | 3 | 96 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_cross.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_cross.mcfunction) | mcfunction | 101 | 2 | 4 | 107 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_div.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_div.mcfunction) | mcfunction | 90 | 19 | 5 | 114 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_dot.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_dot.mcfunction) | mcfunction | 125 | 29 | 6 | 160 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_get.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_get.mcfunction) | mcfunction | 12 | 1 | 0 | 13 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_length.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_length.mcfunction) | mcfunction | 18 | 2 | 2 | 22 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_mult.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_mult.mcfunction) | mcfunction | 57 | 13 | 3 | 73 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_rmv.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_rmv.mcfunction) | mcfunction | 72 | 19 | 3 | 94 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprint.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprint.mcfunction) | mcfunction | 22 | 1 | 3 | 26 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintx.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintx.mcfunction) | mcfunction | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprinty.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprinty.mcfunction) | mcfunction | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintz.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintz.mcfunction) | mcfunction | 7 | 0 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssrandnew.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssrandnew.mcfunction) | mcfunction | 22 | 2 | 3 | 27 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_store.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_store.mcfunction) | mcfunction | 12 | 1 | 0 | 13 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_swap.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_swap.mcfunction) | mcfunction | 12 | 1 | 3 | 16 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_tovec.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_tovec.mcfunction) | mcfunction | 24 | 4 | 3 | 31 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_unit.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_unit.mcfunction) | mcfunction | 20 | 2 | 3 | 25 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_vecto.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_vecto.mcfunction) | mcfunction | 30 | 13 | 3 | 46 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapx.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapx.mcfunction) | mcfunction | 4 | 0 | 2 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapy.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapy.mcfunction) | mcfunction | 4 | 0 | 2 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapz.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapz.mcfunction) | mcfunction | 4 | 0 | 2 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align1.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align3.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align3.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align4.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align4.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align5.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align5.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align6.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align7.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align7.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s0.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s1.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/zero.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/zero.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align1.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align3.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align3.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align4.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align4.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align5.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align5.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align6.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align7.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align7.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s0.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s1.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/zero.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/zero.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align1.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align3.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align3.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align4.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align4.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align5.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align5.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align6.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align7.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align7.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s0.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s1.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/zero.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/zero.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignx.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignx.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_aligny.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_aligny.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignz.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignz.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapx.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapx.mcfunction) | mcfunction | 5 | 0 | 2 | 7 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapy.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapy.mcfunction) | mcfunction | 5 | 0 | 2 | 7 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapz.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapz.mcfunction) | mcfunction | 5 | 0 | 2 | 7 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/length.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/length.mcfunction) | mcfunction | 6 | 2 | 2 | 10 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/main.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/main.mcfunction) | mcfunction | 13 | 2 | 4 | 19 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/new.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/new.mcfunction) | mcfunction | 21 | 2 | 6 | 29 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-1_0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-1_0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-4_-2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-4_-2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/1_2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/1_2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/3_6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/3_6.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-1_0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-1_0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-4_-2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-4_-2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/1_2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/1_2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/3_6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/3_6.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-1_0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-1_0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-4_-2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-4_-2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/1_2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/1_2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/3_6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/3_6.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/_3div.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/_3div.mcfunction) | mcfunction | 15 | 4 | 5 | 24 | +| [mcfpp/math/src/math/data/math/functions/hpo/_4div.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/_4div.mcfunction) | mcfunction | 16 | 4 | 5 | 25 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_add.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_add.mcfunction) | mcfunction | 24 | 7 | 3 | 34 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_cmp.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_cmp.mcfunction) | mcfunction | 11 | 2 | 1 | 14 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_div.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_div.mcfunction) | mcfunction | 34 | 7 | 4 | 45 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_equal.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_equal.mcfunction) | mcfunction | 5 | 1 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_get.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_get.mcfunction) | mcfunction | 4 | 1 | 0 | 5 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_inverse.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_inverse.mcfunction) | mcfunction | 31 | 5 | 3 | 39 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_isbigger.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_isbigger.mcfunction) | mcfunction | 5 | 1 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_isbiggerorequal.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_isbiggerorequal.mcfunction) | mcfunction | 5 | 1 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_issmaller.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_issmaller.mcfunction) | mcfunction | 5 | 1 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_issmallerorequal.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_issmallerorequal.mcfunction) | mcfunction | 5 | 1 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_mult.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_mult.mcfunction) | mcfunction | 19 | 6 | 3 | 28 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_notequal.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_notequal.mcfunction) | mcfunction | 5 | 1 | 0 | 6 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_rmv.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_rmv.mcfunction) | mcfunction | 24 | 7 | 3 | 34 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_scoreto.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_scoreto.mcfunction) | mcfunction | 10 | 5 | 4 | 19 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_sqr.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_sqr.mcfunction) | mcfunction | 17 | 6 | 3 | 26 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_sqrt.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_sqrt.mcfunction) | mcfunction | 14 | 4 | 5 | 23 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_ssprint.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_ssprint.mcfunction) | mcfunction | 7 | 1 | 0 | 8 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_ssrandnew.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_ssrandnew.mcfunction) | mcfunction | 16 | 2 | 2 | 20 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_store.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_store.mcfunction) | mcfunction | 4 | 1 | 0 | 5 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_swap.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_swap.mcfunction) | mcfunction | 4 | 1 | 0 | 5 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_toscore.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_toscore.mcfunction) | mcfunction | 8 | 1 | 3 | 12 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/_zsqr.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/_zsqr.mcfunction) | mcfunction | 17 | 6 | 3 | 26 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/1_2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/1_2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/3_5.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/3_5.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/6_8.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/6_8.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align1.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align3.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align3.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align4.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align4.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align5.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align5.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align6.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align7.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align7.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s0.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s1.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s1.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_search/zero.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/zero.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/add_swap.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/add_swap.mcfunction) | mcfunction | 4 | 1 | 3 | 8 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/datato/_double.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/datato/_double.mcfunction) | mcfunction | 1 | 1 | 1 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/div_align.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/div_align.mcfunction) | mcfunction | 7 | 1 | 0 | 8 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/mult_align.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/mult_align.mcfunction) | mcfunction | 2 | 1 | 1 | 4 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/rmv_swap.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/rmv_swap.mcfunction) | mcfunction | 5 | 1 | 3 | 9 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/test/add.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/test/add.mcfunction) | mcfunction | 14 | 2 | 4 | 20 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/test/div.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/test/div.mcfunction) | mcfunction | 14 | 2 | 4 | 20 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/test/inverse.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/test/inverse.mcfunction) | mcfunction | 8 | 2 | 2 | 12 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/test/mult.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/test/mult.mcfunction) | mcfunction | 14 | 2 | 4 | 20 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/test/rmv.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/test/rmv.mcfunction) | mcfunction | 14 | 2 | 4 | 20 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/test/sqrt.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/test/sqrt.mcfunction) | mcfunction | 7 | 2 | 2 | 11 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/todata/_double.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/todata/_double.mcfunction) | mcfunction | 8 | 1 | 2 | 11 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-3_0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-3_0.mcfunction) | mcfunction | 4 | 0 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_-4.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_-4.mcfunction) | mcfunction | 4 | 0 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_8.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_8.mcfunction) | mcfunction | 4 | 0 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/1_4.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/1_4.mcfunction) | mcfunction | 4 | 0 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/5_8.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/5_8.mcfunction) | mcfunction | 4 | 0 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-1_0.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-1_0.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-4_-2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-4_-2.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/toscore/1_2.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/1_2.mcfunction) | mcfunction | 2 | 0 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/toscore/3_6.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/3_6.mcfunction) | mcfunction | 3 | 0 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/hpo/float/zmult_align.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/float/zmult_align.mcfunction) | mcfunction | 2 | 1 | 1 | 4 | +| [mcfpp/math/src/math/data/math/functions/hpo/init.mcfunction](/mcfpp/math/src/math/data/math/functions/hpo/init.mcfunction) | mcfunction | 18 | 4 | 3 | 25 | +| [mcfpp/math/src/math/data/math/functions/init_overworld.mcfunction](/mcfpp/math/src/math/data/math/functions/init_overworld.mcfunction) | mcfunction | 5 | 6 | 1 | 12 | +| [mcfpp/math/src/math/data/math/functions/marker/_chest.mcfunction](/mcfpp/math/src/math/data/math/functions/marker/_chest.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/marker/_math.mcfunction](/mcfpp/math/src/math/data/math/functions/marker/_math.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/marker/_origin.mcfunction](/mcfpp/math/src/math/data/math/functions/marker/_origin.mcfunction) | mcfunction | 1 | 1 | 0 | 2 | +| [mcfpp/math/src/math/data/math/functions/marker/_return.mcfunction](/mcfpp/math/src/math/data/math/functions/marker/_return.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/marker/_sign.mcfunction](/mcfpp/math/src/math/data/math/functions/marker/_sign.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/marker/_uuid.mcfunction](/mcfpp/math/src/math/data/math/functions/marker/_uuid.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/obj_entity/_new.mcfunction](/mcfpp/math/src/math/data/math/functions/obj_entity/_new.mcfunction) | mcfunction | 1 | 1 | 1 | 3 | +| [mcfpp/math/src/math/data/math/functions/obj_entity/_reid.mcfunction](/mcfpp/math/src/math/data/math/functions/obj_entity/_reid.mcfunction) | mcfunction | 8 | 5 | 0 | 13 | +| [mcfpp/math/src/math/data/math/functions/obj_entity/get_newint.mcfunction](/mcfpp/math/src/math/data/math/functions/obj_entity/get_newint.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/obj_entity/set.mcfunction](/mcfpp/math/src/math/data/math/functions/obj_entity/set.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/set/_append.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_append.mcfunction) | mcfunction | 7 | 2 | 3 | 12 | +| [mcfpp/math/src/math/data/math/functions/set/_cross.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_cross.mcfunction) | mcfunction | 11 | 4 | 3 | 18 | +| [mcfpp/math/src/math/data/math/functions/set/_diff.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_diff.mcfunction) | mcfunction | 11 | 5 | 3 | 19 | +| [mcfpp/math/src/math/data/math/functions/set/_ex-tags.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_ex-tags.mcfunction) | mcfunction | 4 | 2 | 1 | 7 | +| [mcfpp/math/src/math/data/math/functions/set/_get.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_get.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/set/_merge.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_merge.mcfunction) | mcfunction | 7 | 4 | 3 | 14 | +| [mcfpp/math/src/math/data/math/functions/set/_new.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_new.mcfunction) | mcfunction | 3 | 3 | 1 | 7 | +| [mcfpp/math/src/math/data/math/functions/set/_of.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_of.mcfunction) | mcfunction | 6 | 5 | 3 | 14 | +| [mcfpp/math/src/math/data/math/functions/set/_print.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_print.mcfunction) | mcfunction | 4 | 1 | 1 | 6 | +| [mcfpp/math/src/math/data/math/functions/set/_ssnew.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_ssnew.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/set/_ssprint.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_ssprint.mcfunction) | mcfunction | 4 | 1 | 1 | 6 | +| [mcfpp/math/src/math/data/math/functions/set/_store.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_store.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/set/_subset.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_subset.mcfunction) | mcfunction | 8 | 4 | 4 | 16 | +| [mcfpp/math/src/math/data/math/functions/set/_swap.mcfunction](/mcfpp/math/src/math/data/math/functions/set/_swap.mcfunction) | mcfunction | 7 | 1 | 2 | 10 | +| [mcfpp/math/src/math/data/math/functions/set/append_success.mcfunction](/mcfpp/math/src/math/data/math/functions/set/append_success.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/set/cross_sloop.mcfunction](/mcfpp/math/src/math/data/math/functions/set/cross_sloop.mcfunction) | mcfunction | 8 | 2 | 0 | 10 | +| [mcfpp/math/src/math/data/math/functions/set/cross_success.mcfunction](/mcfpp/math/src/math/data/math/functions/set/cross_success.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/set/diff_sloop.mcfunction](/mcfpp/math/src/math/data/math/functions/set/diff_sloop.mcfunction) | mcfunction | 7 | 2 | 0 | 9 | +| [mcfpp/math/src/math/data/math/functions/set/diff_success.mcfunction](/mcfpp/math/src/math/data/math/functions/set/diff_success.mcfunction) | mcfunction | 4 | 1 | 0 | 5 | +| [mcfpp/math/src/math/data/math/functions/set/init.mcfunction](/mcfpp/math/src/math/data/math/functions/set/init.mcfunction) | mcfunction | 4 | 1 | 2 | 7 | +| [mcfpp/math/src/math/data/math/functions/set/merge_sloop.mcfunction](/mcfpp/math/src/math/data/math/functions/set/merge_sloop.mcfunction) | mcfunction | 7 | 2 | 0 | 9 | +| [mcfpp/math/src/math/data/math/functions/set/merge_success.mcfunction](/mcfpp/math/src/math/data/math/functions/set/merge_success.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/set/set.mcfunction](/mcfpp/math/src/math/data/math/functions/set/set.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/set/subset_sloop.mcfunction](/mcfpp/math/src/math/data/math/functions/set/subset_sloop.mcfunction) | mcfunction | 6 | 2 | 0 | 8 | +| [mcfpp/math/src/math/data/math/functions/set/tags_sloop.mcfunction](/mcfpp/math/src/math/data/math/functions/set/tags_sloop.mcfunction) | mcfunction | 5 | 2 | 0 | 7 | +| [mcfpp/math/src/math/data/math/functions/set/test/base.mcfunction](/mcfpp/math/src/math/data/math/functions/set/test/base.mcfunction) | mcfunction | 32 | 1 | 7 | 40 | +| [mcfpp/math/src/math/data/math/functions/set/test/cross.mcfunction](/mcfpp/math/src/math/data/math/functions/set/test/cross.mcfunction) | mcfunction | 18 | 1 | 5 | 24 | +| [mcfpp/math/src/math/data/math/functions/set/test/diff.mcfunction](/mcfpp/math/src/math/data/math/functions/set/test/diff.mcfunction) | mcfunction | 19 | 1 | 6 | 26 | +| [mcfpp/math/src/math/data/math/functions/set/test/ex-tags.mcfunction](/mcfpp/math/src/math/data/math/functions/set/test/ex-tags.mcfunction) | mcfunction | 10 | 1 | 4 | 15 | +| [mcfpp/math/src/math/data/math/functions/set/test/merge.mcfunction](/mcfpp/math/src/math/data/math/functions/set/test/merge.mcfunction) | mcfunction | 19 | 1 | 6 | 26 | +| [mcfpp/math/src/math/data/math/functions/set/test/of.mcfunction](/mcfpp/math/src/math/data/math/functions/set/test/of.mcfunction) | mcfunction | 9 | 1 | 4 | 14 | +| [mcfpp/math/src/math/data/math/functions/set/test/subset.mcfunction](/mcfpp/math/src/math/data/math/functions/set/test/subset.mcfunction) | mcfunction | 21 | 1 | 6 | 28 | +| [mcfpp/math/src/math/data/math/functions/sqrt/_3self.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/_3self.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/sqrt/_3sqrt.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/_3sqrt.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/sqrt/_self.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/_self.mcfunction) | mcfunction | 16 | 1 | 0 | 17 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range0.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range0.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range1.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range1.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range2.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range2.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range3.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range3.mcfunction) | mcfunction | 21 | 1 | 3 | 25 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range4.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range4.mcfunction) | mcfunction | 18 | 1 | 1 | 20 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range5.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range5.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range6.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range6.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range7.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range7.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range8.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range8.mcfunction) | mcfunction | 21 | 1 | 2 | 24 | +| [mcfpp/math/src/math/data/math/functions/sqrt/range9.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/range9.mcfunction) | mcfunction | 19 | 1 | 2 | 22 | +| [mcfpp/math/src/math/data/math/functions/sqrt/rmv.mcfunction](/mcfpp/math/src/math/data/math/functions/sqrt/rmv.mcfunction) | mcfunction | 2 | 1 | 0 | 3 | +| [mcfpp/math/src/math/data/math/functions/test.mcfunction](/mcfpp/math/src/math/data/math/functions/test.mcfunction) | mcfunction | 3 | 1 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/test/_perf.mcfunction](/mcfpp/math/src/math/data/math/functions/test/_perf.mcfunction) | mcfunction | 7 | 1 | 2 | 10 | +| [mcfpp/math/src/math/data/math/functions/test/perf/_loop.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/_loop.mcfunction) | mcfunction | 3 | 2 | 0 | 5 | +| [mcfpp/math/src/math/data/math/functions/test/perf/_print.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/_print.mcfunction) | mcfunction | 31 | 1 | 4 | 36 | +| [mcfpp/math/src/math/data/math/functions/test/perf/_ssnew.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/_ssnew.mcfunction) | mcfunction | 28 | 1 | 5 | 34 | +| [mcfpp/math/src/math/data/math/functions/test/perf/_ssprint.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/_ssprint.mcfunction) | mcfunction | 26 | 1 | 4 | 31 | +| [mcfpp/math/src/math/data/math/functions/test/perf/_start.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/_start.mcfunction) | mcfunction | 9 | 1 | 2 | 12 | +| [mcfpp/math/src/math/data/math/functions/test/perf/_std.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/_std.mcfunction) | mcfunction | 28 | 1 | 4 | 33 | +| [mcfpp/math/src/math/data/math/functions/test/perf/_tick.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/_tick.mcfunction) | mcfunction | 10 | 1 | 2 | 13 | +| [mcfpp/math/src/math/data/math/functions/test/perf/std_loop0.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/std_loop0.mcfunction) | mcfunction | 2 | 2 | 0 | 4 | +| [mcfpp/math/src/math/data/math/functions/test/perf/std_loop1.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/std_loop1.mcfunction) | mcfunction | 3 | 2 | 0 | 5 | +| [mcfpp/math/src/math/data/math/functions/test/perf/std_loop2.mcfunction](/mcfpp/math/src/math/data/math/functions/test/perf/std_loop2.mcfunction) | mcfunction | 3 | 2 | 0 | 5 | +| [mcfpp/math/src/math/data/math/functions/test/run.mcfunction](/mcfpp/math/src/math/data/math/functions/test/run.mcfunction) | mcfunction | 4 | 1 | 1 | 6 | +| [mcfpp/math/src/math/data/math/functions/tick.mcfunction](/mcfpp/math/src/math/data/math/functions/tick.mcfunction) | mcfunction | 4 | 0 | 2 | 6 | +| [mcfpp/math/src/math/pack.mcmeta](/mcfpp/math/src/math/pack.mcmeta) | JSON | 6 | 0 | 1 | 7 | +| [mcfpp/sys/mcfpp.sys.json](/mcfpp/sys/mcfpp.sys.json) | JSON | 8 | 0 | 0 | 8 | +| [settings.gradle.kts](/settings.gradle.kts) | Kotlinscript | 1 | 0 | 3 | 4 | +| [src/main/cpp/test.cpp](/src/main/cpp/test.cpp) | C++ | 6 | 0 | 2 | 8 | +| [src/main/gen/mcfppLexer.java](/src/main/gen/mcfppLexer.java) | Java | 1,300 | 4 | 19 | 1,323 | +| [src/main/java/top/mcfpp/annotations/InsertCommand.java](/src/main/java/top/mcfpp/annotations/InsertCommand.java) | Java | 9 | 0 | 3 | 12 | +| [src/main/java/top/mcfpp/annotations/MCFPPNative.java](/src/main/java/top/mcfpp/annotations/MCFPPNative.java) | Java | 9 | 0 | 3 | 12 | +| [src/main/java/top/mcfpp/jni/Test.java](/src/main/java/top/mcfpp/jni/Test.java) | Java | 10 | 0 | 4 | 14 | +| [src/main/java/top/mcfpp/lang/MCAnyData.java](/src/main/java/top/mcfpp/lang/MCAnyData.java) | Java | 27 | 2 | 7 | 36 | +| [src/main/java/top/mcfpp/lang/MCIntData.java](/src/main/java/top/mcfpp/lang/MCIntData.java) | Java | 25 | 1 | 8 | 34 | +| [src/main/java/top/mcfpp/lang/NBTDictionaryData.java](/src/main/java/top/mcfpp/lang/NBTDictionaryData.java) | Java | 26 | 0 | 8 | 34 | +| [src/main/java/top/mcfpp/lang/NBTListConcreteData.java](/src/main/java/top/mcfpp/lang/NBTListConcreteData.java) | Java | 181 | 15 | 15 | 211 | +| [src/main/java/top/mcfpp/lang/NBTListData.java](/src/main/java/top/mcfpp/lang/NBTListData.java) | Java | 210 | 11 | 14 | 235 | +| [src/main/java/top/mcfpp/lang/NBTMapData.java](/src/main/java/top/mcfpp/lang/NBTMapData.java) | Java | 44 | 0 | 14 | 58 | +| [src/main/java/top/mcfpp/lang/Range.java](/src/main/java/top/mcfpp/lang/Range.java) | Java | 13 | 11 | 8 | 32 | +| [src/main/java/top/mcfpp/lang/System.java](/src/main/java/top/mcfpp/lang/System.java) | Java | 61 | 10 | 12 | 83 | +| [src/main/java/top/mcfppdoc/antlr/McfppDocVisitor.java](/src/main/java/top/mcfppdoc/antlr/McfppDocVisitor.java) | Java | 4 | 0 | 3 | 7 | +| [src/main/kotlin/top/mcfpp/CompileSettings.kt](/src/main/kotlin/top/mcfpp/CompileSettings.kt) | Kotlin | 5 | 6 | 2 | 13 | +| [src/main/kotlin/top/mcfpp/MCFPP.kt](/src/main/kotlin/top/mcfpp/MCFPP.kt) | Kotlin | 53 | 3 | 3 | 59 | +| [src/main/kotlin/top/mcfpp/Project.kt](/src/main/kotlin/top/mcfpp/Project.kt) | Kotlin | 241 | 116 | 33 | 390 | +| [src/main/kotlin/top/mcfpp/annotations/MCFPNativeProcessor.kt](/src/main/kotlin/top/mcfpp/annotations/MCFPNativeProcessor.kt) | Kotlin | 24 | 0 | 4 | 28 | +| [src/main/kotlin/top/mcfpp/antlr/McfppErrorListener.kt](/src/main/kotlin/top/mcfpp/antlr/McfppErrorListener.kt) | Kotlin | 4 | 0 | 3 | 7 | +| [src/main/kotlin/top/mcfpp/antlr/McfppExprVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/McfppExprVisitor.kt) | Kotlin | 505 | 120 | 28 | 653 | +| [src/main/kotlin/top/mcfpp/antlr/McfppFieldVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/McfppFieldVisitor.kt) | Kotlin | 641 | 162 | 47 | 850 | +| [src/main/kotlin/top/mcfpp/antlr/McfppFuncManager.kt](/src/main/kotlin/top/mcfpp/antlr/McfppFuncManager.kt) | Kotlin | 64 | 35 | 7 | 106 | +| [src/main/kotlin/top/mcfpp/antlr/McfppGenericClassVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassVisitor.kt) | Kotlin | 58 | 9 | 4 | 71 | +| [src/main/kotlin/top/mcfpp/antlr/McfppImVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/McfppImVisitor.kt) | Kotlin | 763 | 235 | 94 | 1,092 | +| [src/main/kotlin/top/mcfpp/antlr/McfppInlineFunctionVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/McfppInlineFunctionVisitor.kt) | Kotlin | 3 | 0 | 2 | 5 | +| [src/main/kotlin/top/mcfpp/antlr/McfppLeftExprVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/McfppLeftExprVisitor.kt) | Kotlin | 184 | 38 | 6 | 228 | +| [src/main/kotlin/top/mcfpp/antlr/McfppTypeVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/McfppTypeVisitor.kt) | Kotlin | 180 | 65 | 13 | 258 | +| [src/main/kotlin/top/mcfpp/antlr/NativeClassVisitor.kt](/src/main/kotlin/top/mcfpp/antlr/NativeClassVisitor.kt) | Kotlin | 3 | 73 | 2 | 78 | +| [src/main/kotlin/top/mcfpp/command/Command.kt](/src/main/kotlin/top/mcfpp/command/Command.kt) | Kotlin | 104 | 53 | 23 | 180 | +| [src/main/kotlin/top/mcfpp/command/CommandList.kt](/src/main/kotlin/top/mcfpp/command/CommandList.kt) | Kotlin | 30 | 0 | 7 | 37 | +| [src/main/kotlin/top/mcfpp/command/Commands.kt](/src/main/kotlin/top/mcfpp/command/Commands.kt) | Kotlin | 75 | 37 | 12 | 124 | +| [src/main/kotlin/top/mcfpp/command/Comment.kt](/src/main/kotlin/top/mcfpp/command/Comment.kt) | Kotlin | 17 | 0 | 7 | 24 | +| [src/main/kotlin/top/mcfpp/command/package-info.kt](/src/main/kotlin/top/mcfpp/command/package-info.kt) | Kotlin | 1 | 5 | 2 | 8 | +| [src/main/kotlin/top/mcfpp/command/tree/CommandTreeModel.kt](/src/main/kotlin/top/mcfpp/command/tree/CommandTreeModel.kt) | Kotlin | 12 | 24 | 4 | 40 | +| [src/main/kotlin/top/mcfpp/command/tree/DownloadHelper.kt](/src/main/kotlin/top/mcfpp/command/tree/DownloadHelper.kt) | Kotlin | 291 | 29 | 23 | 343 | +| [src/main/kotlin/top/mcfpp/commandline/LineCompiler.kt](/src/main/kotlin/top/mcfpp/commandline/LineCompiler.kt) | Kotlin | 60 | 1 | 8 | 69 | +| [src/main/kotlin/top/mcfpp/commandline/Main.kt](/src/main/kotlin/top/mcfpp/commandline/Main.kt) | Kotlin | 72 | 3 | 8 | 83 | +| [src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunction.kt](/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunction.kt) | Kotlin | 31 | 5 | 5 | 41 | +| [src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunctionField.kt](/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunctionField.kt) | Kotlin | 21 | 5 | 3 | 29 | +| [src/main/kotlin/top/mcfpp/compiletime/JavaScriptInterpreter.kt](/src/main/kotlin/top/mcfpp/compiletime/JavaScriptInterpreter.kt) | Kotlin | 11 | 0 | 3 | 14 | +| [src/main/kotlin/top/mcfpp/compiletime/MCControl.kt](/src/main/kotlin/top/mcfpp/compiletime/MCControl.kt) | Kotlin | 6 | 0 | 2 | 8 | +| [src/main/kotlin/top/mcfpp/compiletime/McfppCompileTimeVisitor.kt](/src/main/kotlin/top/mcfpp/compiletime/McfppCompileTimeVisitor.kt) | Kotlin | 173 | 0 | 24 | 197 | +| [src/main/kotlin/top/mcfpp/exception/CommandException.kt](/src/main/kotlin/top/mcfpp/exception/CommandException.kt) | Kotlin | 3 | 0 | 1 | 4 | +| [src/main/kotlin/top/mcfpp/exception/IllegalFormatException.kt](/src/main/kotlin/top/mcfpp/exception/IllegalFormatException.kt) | Kotlin | 3 | 0 | 3 | 6 | +| [src/main/kotlin/top/mcfpp/exception/OperationNotImplementException.kt](/src/main/kotlin/top/mcfpp/exception/OperationNotImplementException.kt) | Kotlin | 5 | 0 | 5 | 10 | +| [src/main/kotlin/top/mcfpp/exception/UndefinedException.kt](/src/main/kotlin/top/mcfpp/exception/UndefinedException.kt) | Kotlin | 3 | 0 | 1 | 4 | +| [src/main/kotlin/top/mcfpp/exception/VariableConverseException.kt](/src/main/kotlin/top/mcfpp/exception/VariableConverseException.kt) | Kotlin | 5 | 0 | 5 | 10 | +| [src/main/kotlin/top/mcfpp/exception/VariableNotResolvedException.kt](/src/main/kotlin/top/mcfpp/exception/VariableNotResolvedException.kt) | Kotlin | 3 | 0 | 3 | 6 | +| [src/main/kotlin/top/mcfpp/io/DatapackCreator.kt](/src/main/kotlin/top/mcfpp/io/DatapackCreator.kt) | Kotlin | 178 | 54 | 8 | 240 | +| [src/main/kotlin/top/mcfpp/io/LibReader.kt](/src/main/kotlin/top/mcfpp/io/LibReader.kt) | Kotlin | 241 | 41 | 8 | 290 | +| [src/main/kotlin/top/mcfpp/io/LibWriter.kt](/src/main/kotlin/top/mcfpp/io/LibWriter.kt) | Kotlin | 169 | 26 | 9 | 204 | +| [src/main/kotlin/top/mcfpp/io/MCFPPFile.kt](/src/main/kotlin/top/mcfpp/io/MCFPPFile.kt) | Kotlin | 103 | 18 | 14 | 135 | +| [src/main/kotlin/top/mcfpp/lang/CanSelectMember.kt](/src/main/kotlin/top/mcfpp/lang/CanSelectMember.kt) | Kotlin | 9 | 19 | 5 | 33 | +| [src/main/kotlin/top/mcfpp/lang/ClassBase.kt](/src/main/kotlin/top/mcfpp/lang/ClassBase.kt) | Kotlin | 16 | 19 | 4 | 39 | +| [src/main/kotlin/top/mcfpp/lang/ClassObject.kt](/src/main/kotlin/top/mcfpp/lang/ClassObject.kt) | Kotlin | 65 | 46 | 15 | 126 | +| [src/main/kotlin/top/mcfpp/lang/ClassPointer.kt](/src/main/kotlin/top/mcfpp/lang/ClassPointer.kt) | Kotlin | 130 | 70 | 21 | 221 | +| [src/main/kotlin/top/mcfpp/lang/CompoundDataType.kt](/src/main/kotlin/top/mcfpp/lang/CompoundDataType.kt) | Kotlin | 49 | 25 | 10 | 84 | +| [src/main/kotlin/top/mcfpp/lang/Entity.kt](/src/main/kotlin/top/mcfpp/lang/Entity.kt) | Kotlin | 13 | 127 | 2 | 142 | +| [src/main/kotlin/top/mcfpp/lang/INativeClass.kt](/src/main/kotlin/top/mcfpp/lang/INativeClass.kt) | Kotlin | 9 | 9 | 2 | 20 | +| [src/main/kotlin/top/mcfpp/lang/Indexable.kt](/src/main/kotlin/top/mcfpp/lang/Indexable.kt) | Kotlin | 4 | 0 | 3 | 7 | +| [src/main/kotlin/top/mcfpp/lang/IntTemplateBase.kt](/src/main/kotlin/top/mcfpp/lang/IntTemplateBase.kt) | Kotlin | 7 | 3 | 5 | 15 | +| [src/main/kotlin/top/mcfpp/lang/IntTemplatePointer.kt](/src/main/kotlin/top/mcfpp/lang/IntTemplatePointer.kt) | Kotlin | 45 | 27 | 15 | 87 | +| [src/main/kotlin/top/mcfpp/lang/IntTemplateType.kt](/src/main/kotlin/top/mcfpp/lang/IntTemplateType.kt) | Kotlin | 7 | 0 | 4 | 11 | +| [src/main/kotlin/top/mcfpp/lang/JavaVar.kt](/src/main/kotlin/top/mcfpp/lang/JavaVar.kt) | Kotlin | 136 | 69 | 23 | 228 | +| [src/main/kotlin/top/mcfpp/lang/JsonString.kt](/src/main/kotlin/top/mcfpp/lang/JsonString.kt) | Kotlin | 10 | 87 | 2 | 99 | +| [src/main/kotlin/top/mcfpp/lang/JsonText.kt](/src/main/kotlin/top/mcfpp/lang/JsonText.kt) | Kotlin | 35 | 15 | 12 | 62 | +| [src/main/kotlin/top/mcfpp/lang/MCAny.kt](/src/main/kotlin/top/mcfpp/lang/MCAny.kt) | Kotlin | 128 | 119 | 24 | 271 | +| [src/main/kotlin/top/mcfpp/lang/MCBool.kt](/src/main/kotlin/top/mcfpp/lang/MCBool.kt) | Kotlin | 251 | 53 | 37 | 341 | +| [src/main/kotlin/top/mcfpp/lang/MCFPPTypeVar.kt](/src/main/kotlin/top/mcfpp/lang/MCFPPTypeVar.kt) | Kotlin | 56 | 0 | 15 | 71 | +| [src/main/kotlin/top/mcfpp/lang/MCFloat.kt](/src/main/kotlin/top/mcfpp/lang/MCFloat.kt) | Kotlin | 576 | 210 | 57 | 843 | +| [src/main/kotlin/top/mcfpp/lang/MCInt.kt](/src/main/kotlin/top/mcfpp/lang/MCInt.kt) | Kotlin | 565 | 96 | 51 | 712 | +| [src/main/kotlin/top/mcfpp/lang/MCNumber.kt](/src/main/kotlin/top/mcfpp/lang/MCNumber.kt) | Kotlin | 43 | 86 | 22 | 151 | +| [src/main/kotlin/top/mcfpp/lang/MCString.kt](/src/main/kotlin/top/mcfpp/lang/MCString.kt) | Kotlin | 118 | 59 | 20 | 197 | +| [src/main/kotlin/top/mcfpp/lang/NBTAny.kt](/src/main/kotlin/top/mcfpp/lang/NBTAny.kt) | Kotlin | 1 | 147 | 1 | 149 | +| [src/main/kotlin/top/mcfpp/lang/NBTBasedData.kt](/src/main/kotlin/top/mcfpp/lang/NBTBasedData.kt) | Kotlin | 518 | 116 | 46 | 680 | +| [src/main/kotlin/top/mcfpp/lang/NBTDictionary.kt](/src/main/kotlin/top/mcfpp/lang/NBTDictionary.kt) | Kotlin | 146 | 56 | 24 | 226 | +| [src/main/kotlin/top/mcfpp/lang/NBTList.kt](/src/main/kotlin/top/mcfpp/lang/NBTList.kt) | Kotlin | 151 | 53 | 26 | 230 | +| [src/main/kotlin/top/mcfpp/lang/NBTMap.kt](/src/main/kotlin/top/mcfpp/lang/NBTMap.kt) | Kotlin | 67 | 40 | 12 | 119 | +| [src/main/kotlin/top/mcfpp/lang/NBTTemplateBase.kt](/src/main/kotlin/top/mcfpp/lang/NBTTemplateBase.kt) | Kotlin | 3 | 0 | 1 | 4 | +| [src/main/kotlin/top/mcfpp/lang/NBTTemplatePointer.kt](/src/main/kotlin/top/mcfpp/lang/NBTTemplatePointer.kt) | Kotlin | 3 | 0 | 1 | 4 | +| [src/main/kotlin/top/mcfpp/lang/NBTTemplateType.kt](/src/main/kotlin/top/mcfpp/lang/NBTTemplateType.kt) | Kotlin | 3 | 0 | 1 | 4 | +| [src/main/kotlin/top/mcfpp/lang/OnScoreboard.kt](/src/main/kotlin/top/mcfpp/lang/OnScoreboard.kt) | Kotlin | 4 | 3 | 1 | 8 | +| [src/main/kotlin/top/mcfpp/lang/Range.kt](/src/main/kotlin/top/mcfpp/lang/Range.kt) | Kotlin | 1 | 3 | 1 | 5 | +| [src/main/kotlin/top/mcfpp/lang/ReturnedMCBool.kt](/src/main/kotlin/top/mcfpp/lang/ReturnedMCBool.kt) | Kotlin | 28 | 22 | 7 | 57 | +| [src/main/kotlin/top/mcfpp/lang/SbObject.kt](/src/main/kotlin/top/mcfpp/lang/SbObject.kt) | Kotlin | 43 | 20 | 13 | 76 | +| [src/main/kotlin/top/mcfpp/lang/Selector.kt](/src/main/kotlin/top/mcfpp/lang/Selector.kt) | Kotlin | 17 | 158 | 3 | 178 | +| [src/main/kotlin/top/mcfpp/lang/Storage.kt](/src/main/kotlin/top/mcfpp/lang/Storage.kt) | Kotlin | 26 | 5 | 8 | 39 | +| [src/main/kotlin/top/mcfpp/lang/UnknownVar.kt](/src/main/kotlin/top/mcfpp/lang/UnknownVar.kt) | Kotlin | 25 | 27 | 13 | 65 | +| [src/main/kotlin/top/mcfpp/lang/UnresolvedVar.kt](/src/main/kotlin/top/mcfpp/lang/UnresolvedVar.kt) | Kotlin | 51 | 56 | 16 | 123 | +| [src/main/kotlin/top/mcfpp/lang/Var.kt](/src/main/kotlin/top/mcfpp/lang/Var.kt) | Kotlin | 179 | 149 | 43 | 371 | +| [src/main/kotlin/top/mcfpp/lang/Void.kt](/src/main/kotlin/top/mcfpp/lang/Void.kt) | Kotlin | 47 | 27 | 11 | 85 | +| [src/main/kotlin/top/mcfpp/lang/annotation/Inject.kt](/src/main/kotlin/top/mcfpp/lang/annotation/Inject.kt) | Kotlin | 22 | 2 | 6 | 30 | +| [src/main/kotlin/top/mcfpp/lang/type/MCFPPBaseType.kt](/src/main/kotlin/top/mcfpp/lang/type/MCFPPBaseType.kt) | Kotlin | 61 | 18 | 7 | 86 | +| [src/main/kotlin/top/mcfpp/lang/type/MCFPPClassType.kt](/src/main/kotlin/top/mcfpp/lang/type/MCFPPClassType.kt) | Kotlin | 66 | 22 | 11 | 99 | +| [src/main/kotlin/top/mcfpp/lang/type/MCFPPGenericClassType.kt](/src/main/kotlin/top/mcfpp/lang/type/MCFPPGenericClassType.kt) | Kotlin | 9 | 0 | 4 | 13 | +| [src/main/kotlin/top/mcfpp/lang/type/MCFPPGenericType.kt](/src/main/kotlin/top/mcfpp/lang/type/MCFPPGenericType.kt) | Kotlin | 13 | 17 | 4 | 34 | +| [src/main/kotlin/top/mcfpp/lang/type/MCFPPNBTType.kt](/src/main/kotlin/top/mcfpp/lang/type/MCFPPNBTType.kt) | Kotlin | 46 | 17 | 16 | 79 | +| [src/main/kotlin/top/mcfpp/lang/type/MCFPPTemplateType.kt](/src/main/kotlin/top/mcfpp/lang/type/MCFPPTemplateType.kt) | Kotlin | 22 | 4 | 7 | 33 | +| [src/main/kotlin/top/mcfpp/lang/type/MCFPPType.kt](/src/main/kotlin/top/mcfpp/lang/type/MCFPPType.kt) | Kotlin | 155 | 56 | 26 | 237 | +| [src/main/kotlin/top/mcfpp/lang/value/MCFPPTypeValue.kt](/src/main/kotlin/top/mcfpp/lang/value/MCFPPTypeValue.kt) | Kotlin | 46 | 8 | 12 | 66 | +| [src/main/kotlin/top/mcfpp/lang/value/MCFPPValue.kt](/src/main/kotlin/top/mcfpp/lang/value/MCFPPValue.kt) | Kotlin | 8 | 7 | 3 | 18 | +| [src/main/kotlin/top/mcfpp/lib/ConstantPool.kt](/src/main/kotlin/top/mcfpp/lib/ConstantPool.kt) | Kotlin | 4 | 0 | 4 | 8 | +| [src/main/kotlin/top/mcfpp/lib/MacroFunctionGenerator.kt](/src/main/kotlin/top/mcfpp/lib/MacroFunctionGenerator.kt) | Kotlin | 2 | 0 | 2 | 4 | +| [src/main/kotlin/top/mcfpp/model/Annotation.kt](/src/main/kotlin/top/mcfpp/model/Annotation.kt) | Kotlin | 41 | 25 | 12 | 78 | +| [src/main/kotlin/top/mcfpp/model/Class.kt](/src/main/kotlin/top/mcfpp/model/Class.kt) | Kotlin | 104 | 87 | 26 | 217 | +| [src/main/kotlin/top/mcfpp/model/CompoundData.kt](/src/main/kotlin/top/mcfpp/model/CompoundData.kt) | Kotlin | 104 | 63 | 19 | 186 | +| [src/main/kotlin/top/mcfpp/model/FieldContainer.kt](/src/main/kotlin/top/mcfpp/model/FieldContainer.kt) | Kotlin | 4 | 7 | 1 | 12 | +| [src/main/kotlin/top/mcfpp/model/Interface.kt](/src/main/kotlin/top/mcfpp/model/Interface.kt) | Kotlin | 14 | 12 | 5 | 31 | +| [src/main/kotlin/top/mcfpp/model/Member.kt](/src/main/kotlin/top/mcfpp/model/Member.kt) | Kotlin | 10 | 21 | 6 | 37 | +| [src/main/kotlin/top/mcfpp/model/Native.kt](/src/main/kotlin/top/mcfpp/model/Native.kt) | Kotlin | 2 | 0 | 1 | 3 | +| [src/main/kotlin/top/mcfpp/model/NativeClass.kt](/src/main/kotlin/top/mcfpp/model/NativeClass.kt) | Kotlin | 13 | 3 | 4 | 20 | +| [src/main/kotlin/top/mcfpp/model/Template.kt](/src/main/kotlin/top/mcfpp/model/Template.kt) | Kotlin | 57 | 34 | 13 | 104 | +| [src/main/kotlin/top/mcfpp/model/UnknownClass.kt](/src/main/kotlin/top/mcfpp/model/UnknownClass.kt) | Kotlin | 3 | 0 | 2 | 5 | +| [src/main/kotlin/top/mcfpp/model/field/CompoundDataField.kt](/src/main/kotlin/top/mcfpp/model/field/CompoundDataField.kt) | Kotlin | 122 | 46 | 28 | 196 | +| [src/main/kotlin/top/mcfpp/model/field/FileField.kt](/src/main/kotlin/top/mcfpp/model/field/FileField.kt) | Kotlin | 2 | 0 | 1 | 3 | +| [src/main/kotlin/top/mcfpp/model/field/FunctionField.kt](/src/main/kotlin/top/mcfpp/model/field/FunctionField.kt) | Kotlin | 106 | 57 | 25 | 188 | +| [src/main/kotlin/top/mcfpp/model/field/GlobalField.kt](/src/main/kotlin/top/mcfpp/model/field/GlobalField.kt) | Kotlin | 263 | 71 | 21 | 355 | +| [src/main/kotlin/top/mcfpp/model/field/IField.kt](/src/main/kotlin/top/mcfpp/model/field/IField.kt) | Kotlin | 3 | 20 | 3 | 26 | +| [src/main/kotlin/top/mcfpp/model/field/IFieldWithClass.kt](/src/main/kotlin/top/mcfpp/model/field/IFieldWithClass.kt) | Kotlin | 10 | 36 | 8 | 54 | +| [src/main/kotlin/top/mcfpp/model/field/IFieldWithFunction.kt](/src/main/kotlin/top/mcfpp/model/field/IFieldWithFunction.kt) | Kotlin | 9 | 17 | 6 | 32 | +| [src/main/kotlin/top/mcfpp/model/field/IFieldWithInterface.kt](/src/main/kotlin/top/mcfpp/model/field/IFieldWithInterface.kt) | Kotlin | 10 | 32 | 8 | 50 | +| [src/main/kotlin/top/mcfpp/model/field/IFieldWithTemplate.kt](/src/main/kotlin/top/mcfpp/model/field/IFieldWithTemplate.kt) | Kotlin | 12 | 32 | 7 | 51 | +| [src/main/kotlin/top/mcfpp/model/field/IFieldWithType.kt](/src/main/kotlin/top/mcfpp/model/field/IFieldWithType.kt) | Kotlin | 10 | 27 | 8 | 45 | +| [src/main/kotlin/top/mcfpp/model/field/IFieldWithVar.kt](/src/main/kotlin/top/mcfpp/model/field/IFieldWithVar.kt) | Kotlin | 10 | 27 | 8 | 45 | +| [src/main/kotlin/top/mcfpp/model/field/InternalFunctionField.kt](/src/main/kotlin/top/mcfpp/model/field/InternalFunctionField.kt) | Kotlin | 51 | 20 | 10 | 81 | +| [src/main/kotlin/top/mcfpp/model/field/NamespaceField.kt](/src/main/kotlin/top/mcfpp/model/field/NamespaceField.kt) | Kotlin | 185 | 160 | 42 | 387 | +| [src/main/kotlin/top/mcfpp/model/field/NoStackFunctionField.kt](/src/main/kotlin/top/mcfpp/model/field/NoStackFunctionField.kt) | Kotlin | 11 | 5 | 4 | 20 | +| [src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithFunction.kt](/src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithFunction.kt) | Kotlin | 39 | 13 | 9 | 61 | +| [src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithType.kt](/src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithType.kt) | Kotlin | 35 | 3 | 9 | 47 | +| [src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithVar.kt](/src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithVar.kt) | Kotlin | 37 | 30 | 9 | 76 | +| [src/main/kotlin/top/mcfpp/model/function/Constructor.kt](/src/main/kotlin/top/mcfpp/model/function/Constructor.kt) | Kotlin | 108 | 26 | 9 | 143 | +| [src/main/kotlin/top/mcfpp/model/function/ExtensionFunction.kt](/src/main/kotlin/top/mcfpp/model/function/ExtensionFunction.kt) | Kotlin | 40 | 14 | 7 | 61 | +| [src/main/kotlin/top/mcfpp/model/function/Function.kt](/src/main/kotlin/top/mcfpp/model/function/Function.kt) | Kotlin | 480 | 375 | 72 | 927 | +| [src/main/kotlin/top/mcfpp/model/function/FunctionParam.kt](/src/main/kotlin/top/mcfpp/model/function/FunctionParam.kt) | Kotlin | 74 | 32 | 15 | 121 | +| [src/main/kotlin/top/mcfpp/model/function/FunctionTag.kt](/src/main/kotlin/top/mcfpp/model/function/FunctionTag.kt) | Kotlin | 47 | 12 | 8 | 67 | +| [src/main/kotlin/top/mcfpp/model/function/InlineFunction.kt](/src/main/kotlin/top/mcfpp/model/function/InlineFunction.kt) | Kotlin | 38 | 50 | 11 | 99 | +| [src/main/kotlin/top/mcfpp/model/function/InternalFunction.kt](/src/main/kotlin/top/mcfpp/model/function/InternalFunction.kt) | Kotlin | 24 | 28 | 6 | 58 | +| [src/main/kotlin/top/mcfpp/model/function/JavaFunction.kt](/src/main/kotlin/top/mcfpp/model/function/JavaFunction.kt) | Kotlin | 17 | 2 | 6 | 25 | +| [src/main/kotlin/top/mcfpp/model/function/NativeConstructor.kt](/src/main/kotlin/top/mcfpp/model/function/NativeConstructor.kt) | Kotlin | 11 | 0 | 2 | 13 | +| [src/main/kotlin/top/mcfpp/model/function/NativeFunction.kt](/src/main/kotlin/top/mcfpp/model/function/NativeFunction.kt) | Kotlin | 62 | 57 | 18 | 137 | +| [src/main/kotlin/top/mcfpp/model/function/NoStackFunction.kt](/src/main/kotlin/top/mcfpp/model/function/NoStackFunction.kt) | Kotlin | 8 | 0 | 4 | 12 | +| [src/main/kotlin/top/mcfpp/model/function/TemplateConstructor.kt](/src/main/kotlin/top/mcfpp/model/function/TemplateConstructor.kt) | Kotlin | 22 | 1 | 4 | 27 | +| [src/main/kotlin/top/mcfpp/model/function/UnknownFunction.kt](/src/main/kotlin/top/mcfpp/model/function/UnknownFunction.kt) | Kotlin | 13 | 5 | 3 | 21 | +| [src/main/kotlin/top/mcfpp/model/generic/Generic.kt](/src/main/kotlin/top/mcfpp/model/generic/Generic.kt) | Kotlin | 16 | 0 | 10 | 26 | +| [src/main/kotlin/top/mcfpp/model/generic/GenericClass.kt](/src/main/kotlin/top/mcfpp/model/generic/GenericClass.kt) | Kotlin | 47 | 13 | 17 | 77 | +| [src/main/kotlin/top/mcfpp/model/generic/GenericExtensionFunction.kt](/src/main/kotlin/top/mcfpp/model/generic/GenericExtensionFunction.kt) | Kotlin | 118 | 15 | 13 | 146 | +| [src/main/kotlin/top/mcfpp/model/generic/GenericFunction.kt](/src/main/kotlin/top/mcfpp/model/generic/GenericFunction.kt) | Kotlin | 141 | 29 | 15 | 185 | +| [src/main/kotlin/top/mcfpp/model/package-info.kt](/src/main/kotlin/top/mcfpp/model/package-info.kt) | Kotlin | 1 | 3 | 2 | 6 | +| [src/main/kotlin/top/mcfpp/package-info.kt](/src/main/kotlin/top/mcfpp/package-info.kt) | Kotlin | 1 | 0 | 2 | 3 | +| [src/main/kotlin/top/mcfpp/util/AntlrUtil.kt](/src/main/kotlin/top/mcfpp/util/AntlrUtil.kt) | Kotlin | 18 | 0 | 4 | 22 | +| [src/main/kotlin/top/mcfpp/util/AnyTag.kt](/src/main/kotlin/top/mcfpp/util/AnyTag.kt) | Kotlin | 11 | 5 | 5 | 21 | +| [src/main/kotlin/top/mcfpp/util/LazyWrapper.kt](/src/main/kotlin/top/mcfpp/util/LazyWrapper.kt) | Kotlin | 31 | 11 | 9 | 51 | +| [src/main/kotlin/top/mcfpp/util/LogProcesser.kt](/src/main/kotlin/top/mcfpp/util/LogProcesser.kt) | Kotlin | 36 | 0 | 11 | 47 | +| [src/main/kotlin/top/mcfpp/util/MCUUID.kt](/src/main/kotlin/top/mcfpp/util/MCUUID.kt) | Kotlin | 20 | 0 | 7 | 27 | +| [src/main/kotlin/top/mcfpp/util/MacroHelper.kt](/src/main/kotlin/top/mcfpp/util/MacroHelper.kt) | Kotlin | 12 | 5 | 4 | 21 | +| [src/main/kotlin/top/mcfpp/util/NBTUtil.kt](/src/main/kotlin/top/mcfpp/util/NBTUtil.kt) | Kotlin | 105 | 5 | 16 | 126 | +| [src/main/kotlin/top/mcfpp/util/ResourceLocation.kt](/src/main/kotlin/top/mcfpp/util/ResourceLocation.kt) | Kotlin | 22 | 17 | 5 | 44 | +| [src/main/kotlin/top/mcfpp/util/StringHelper.kt](/src/main/kotlin/top/mcfpp/util/StringHelper.kt) | Kotlin | 34 | 5 | 4 | 43 | +| [src/main/kotlin/top/mcfpp/util/Utils.kt](/src/main/kotlin/top/mcfpp/util/Utils.kt) | Kotlin | 60 | 10 | 16 | 86 | +| [src/main/kotlin/top/mcfpp/util/UwU.kt](/src/main/kotlin/top/mcfpp/util/UwU.kt) | Kotlin | 66 | 4 | 4 | 74 | +| [src/main/kotlin/top/mcfpp/util/ValueWrapper.kt](/src/main/kotlin/top/mcfpp/util/ValueWrapper.kt) | Kotlin | 2 | 0 | 1 | 3 | +| [src/test/java/top/mcfpp/test/GenericsTest.java](/src/test/java/top/mcfpp/test/GenericsTest.java) | Java | 41 | 0 | 10 | 51 | +| [src/test/java/top/mcfpp/test/NativeTest.java](/src/test/java/top/mcfpp/test/NativeTest.java) | Java | 8 | 0 | 3 | 11 | +| [src/test/kotlin/top/mcfpp/test/CommandTreeDeserializeTest.kt](/src/test/kotlin/top/mcfpp/test/CommandTreeDeserializeTest.kt) | Kotlin | 92 | 0 | 5 | 97 | +| [src/test/kotlin/top/mcfpp/test/CompileTest.kt](/src/test/kotlin/top/mcfpp/test/CompileTest.kt) | Kotlin | 113 | 0 | 16 | 129 | +| [src/test/kotlin/top/mcfpp/test/CompileTimeTest.kt](/src/test/kotlin/top/mcfpp/test/CompileTimeTest.kt) | Kotlin | 36 | 1 | 3 | 40 | +| [src/test/kotlin/top/mcfpp/test/FloatTest.kt](/src/test/kotlin/top/mcfpp/test/FloatTest.kt) | Kotlin | 19 | 0 | 3 | 22 | +| [src/test/kotlin/top/mcfpp/test/JavaScriptInterpreterTest.kt](/src/test/kotlin/top/mcfpp/test/JavaScriptInterpreterTest.kt) | Kotlin | 9 | 0 | 4 | 13 | +| [src/test/kotlin/top/mcfpp/test/MCFPPStringTest.kt](/src/test/kotlin/top/mcfpp/test/MCFPPStringTest.kt) | Kotlin | 98 | 16 | 3 | 117 | +| [src/test/kotlin/top/mcfpp/test/NBTAnyDataTypeTest.kt](/src/test/kotlin/top/mcfpp/test/NBTAnyDataTypeTest.kt) | Kotlin | 18 | 0 | 4 | 22 | +| [src/test/kotlin/top/mcfpp/test/NBTTest.kts](/src/test/kotlin/top/mcfpp/test/NBTTest.kts) | Kotlinscript | 3 | 0 | 2 | 5 | +| [src/test/kotlin/top/mcfpp/test/NashornTest.kt](/src/test/kotlin/top/mcfpp/test/NashornTest.kt) | Kotlin | 12 | 0 | 3 | 15 | +| [src/test/kotlin/top/mcfpp/test/NativeTest1.kt](/src/test/kotlin/top/mcfpp/test/NativeTest1.kt) | Kotlin | 17 | 0 | 3 | 20 | +| [src/test/kotlin/top/mcfpp/test/StringCompileTest.kt](/src/test/kotlin/top/mcfpp/test/StringCompileTest.kt) | Kotlin | 13 | 0 | 4 | 17 | +| [src/test/kotlin/top/mcfpp/test/StringTest.kt](/src/test/kotlin/top/mcfpp/test/StringTest.kt) | Kotlin | 14 | 0 | 4 | 18 | +| [test/Test.json](/test/Test.json) | JSON | 8 | 0 | 0 | 8 | + +[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/diff-details.md b/.VSCodeCounter/2024-05-14_19-40-04/diff-details.md new file mode 100644 index 00000000..10a7df53 --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/diff-details.md @@ -0,0 +1,15 @@ +# Diff Details + +Date : 2024-05-14 19:40:04 + +Directory g:\\AST\\MCFPP + +Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines + +[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details + +## Files +| filename | language | code | comment | blank | total | +| :--- | :--- | ---: | ---: | ---: | ---: | + +[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/diff.csv b/.VSCodeCounter/2024-05-14_19-40-04/diff.csv new file mode 100644 index 00000000..b7d8d759 --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/diff.csv @@ -0,0 +1,2 @@ +"filename", "language", "", "comment", "blank", "total" +"Total", "-", , 0, 0, 0 \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/diff.md b/.VSCodeCounter/2024-05-14_19-40-04/diff.md new file mode 100644 index 00000000..2eca52de --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/diff.md @@ -0,0 +1,19 @@ +# Diff Summary + +Date : 2024-05-14 19:40:04 + +Directory g:\\AST\\MCFPP + +Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines + +[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | + +[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/diff.txt b/.VSCodeCounter/2024-05-14_19-40-04/diff.txt new file mode 100644 index 00000000..c04b40a8 --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/diff.txt @@ -0,0 +1,22 @@ +Date : 2024-05-14 19:40:04 +Directory : g:\AST\MCFPP +Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines + +Languages ++----------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++----------+------------+------------+------------+------------+------------+ ++----------+------------+------------+------------+------------+------------+ + +Directories ++------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++------+------------+------------+------------+------------+------------+ ++------+------------+------------+------------+------------+------------+ + +Files ++----------+----------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++----------+----------+------------+------------+------------+------------+ +| Total | | 0 | 0 | 0 | 0 | ++----------+----------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/results.csv b/.VSCodeCounter/2024-05-14_19-40-04/results.csv new file mode 100644 index 00000000..f919be7b --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/results.csv @@ -0,0 +1,500 @@ +"filename", "language", "Markdown", "Properties", "Kotlinscript", "Batch", "JSON", "C++", "Kotlin", "Java", "mcfunction", "XML", "comment", "blank", "total" +"g:\AST\MCFPP\.idea\codeStyles\Project.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 15 +"g:\AST\MCFPP\.idea\codeStyles\codeStyleConfig.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 5 +"g:\AST\MCFPP\.idea\encodings.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 9 +"g:\AST\MCFPP\.idea\gradle.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 17 +"g:\AST\MCFPP\.idea\inspectionProfiles\Project_Default.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 6 +"g:\AST\MCFPP\.idea\kotlinScripting.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 +"g:\AST\MCFPP\.idea\kotlinc.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 6 +"g:\AST\MCFPP\.idea\misc.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 43 +"g:\AST\MCFPP\.idea\statistic.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 7 +"g:\AST\MCFPP\.idea\uiDesigner.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 124 +"g:\AST\MCFPP\.idea\vcs.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 6 +"g:\AST\MCFPP\README.md", "Markdown", 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 69 +"g:\AST\MCFPP\README_CN.md", "Markdown", 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 69 +"g:\AST\MCFPP\TODO.md", "Markdown", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 29 +"g:\AST\MCFPP\TODO_CN.md", "Markdown", 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 29 +"g:\AST\MCFPP\build.gradle.kts", "Kotlinscript", 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 14, 96 +"g:\AST\MCFPP\gradle.properties", "Properties", 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3 +"g:\AST\MCFPP\gradle\wrapper\gradle-wrapper.properties", "Properties", 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6 +"g:\AST\MCFPP\gradlew.bat", "Batch", 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 29, 22, 90 +"g:\AST\MCFPP\log4j2.xml", "XML", 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 13 +"g:\AST\MCFPP\mcfpp\dynamic\mcfpp.dynamic.json", "JSON", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions\nbt\append_number_index.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 1, 4 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions\nbt\join_path.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 5, 2, 13 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions\nbt\z_join.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\everything.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\multi.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\only.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\only_with_criterion.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute\get.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute\get_scale.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute\modifier\add.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\entity.from.storage.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 1, 5 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\entity.from.storage_sp.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 1, 6 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\entity.from.storage_sp2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 1, 6 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.append.from.entity_sp.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 1, 6 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.entity_sp3.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 1, 6 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.entity_sp5.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 1, 6 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.storage.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 1, 5 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.storage_sp4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 1, 5 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.storage_sp6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 1, 5 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\function.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 4 +"g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\pack.mcmeta", "JSON", 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 1, 7 +"g:\AST\MCFPP\mcfpp\math\mcfpp.math.json", "JSON", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\README.md", "Markdown", 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls1.json", "JSON", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls10.json", "JSON", 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls11.json", "JSON", 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls12.json", "JSON", 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls13.json", "JSON", 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls14.json", "JSON", 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls15.json", "JSON", 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls16.json", "JSON", 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls2.json", "JSON", 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls3.json", "JSON", 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls4.json", "JSON", 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls5.json", "JSON", 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 10 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls6.json", "JSON", 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 15 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls7.json", "JSON", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls8.json", "JSON", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls9.json", "JSON", 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen1.json", "JSON", 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 17 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen2.json", "JSON", 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 25 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen3.json", "JSON", 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 26 +"g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen4.json", "JSON", 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 25 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_coordto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 1, 10 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_cross.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 1, 2, 23 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_dsp-ex.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 1, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_dsp.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 4, 4, 31 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ex-len.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 5, 39 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ex-rot.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 10, 6, 43 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ex-xyz.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 8, 4, 42 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_facingto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_fposto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_get.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 1, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ldsp-ex.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ldsp.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 4, 3, 29 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_polar.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 14, 7, 48 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_posto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 1, 11 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_print.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ssprint.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ssrandnew.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 1, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_store.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 1, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_tofacing.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_tofpos.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_topos.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 1, 11 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_tosto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 2, 13 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\dsp\arrow.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 24, 148 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\dsp\loop0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 2, 23 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\dsp\loop1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 1, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\3div.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\range0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\range1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\range2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\init.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 1, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_init.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 14, 14, 87 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_posto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_random.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 0, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_refacing.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 1, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_sincos.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_sqrt.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 0, 20 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_topos.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_version.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_xyz.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\_append.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\_ssnew.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\new_group.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\sloop.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 3, 0, 10 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3div_resign.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_add.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 74, 0, 19, 3, 96 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_cross.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 2, 4, 107 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_div.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 19, 5, 114 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_dot.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 29, 6, 160 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_get.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 1, 0, 13 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_length.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 2, 2, 22 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_mult.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 57, 0, 13, 3, 73 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_rmv.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 19, 3, 94 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprint.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 1, 3, 26 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprintx.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprinty.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprintz.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssrandnew.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 2, 3, 27 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_store.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 1, 0, 13 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_swap.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 1, 3, 16 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_tovec.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 4, 3, 31 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_unit.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 2, 3, 25 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_vecto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 13, 3, 46 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\add_swapx.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 2, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\add_swapy.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 2, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\add_swapz.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 2, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align3.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align5.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align7.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align_s0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align_s1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align_s2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\zero.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align3.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align5.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align7.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align_s0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align_s1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align_s2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\zero.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align3.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align5.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align7.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align_s0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align_s1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align_s2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\zero.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\mult_alignx.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\mult_aligny.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\mult_alignz.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\rmv_swapx.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 2, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\rmv_swapy.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 2, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\rmv_swapz.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 2, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\test\length.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 2, 2, 10 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\test\main.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 2, 4, 19 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\test\new.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 2, 6, 29 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\-1_0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\-4_-2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\1_2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\3_6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\-1_0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\-4_-2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\1_2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\3_6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\-1_0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\-4_-2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\1_2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\3_6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\_3div.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 4, 5, 24 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\_4div.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 5, 25 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_add.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 7, 3, 34 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_cmp.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 2, 1, 14 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_div.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 7, 4, 45 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_equal.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_get.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 5 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_inverse.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 5, 3, 39 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_isbigger.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_isbiggerorequal.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_issmaller.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_issmallerorequal.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_mult.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 6, 3, 28 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_notequal.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_rmv.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 7, 3, 34 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_scoreto.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 5, 4, 19 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_sqr.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 6, 3, 26 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_sqrt.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 4, 5, 23 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_ssprint.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_ssrandnew.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 2, 2, 20 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_store.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 5 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_swap.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 5 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_toscore.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 1, 3, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_zsqr.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 6, 3, 26 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\1_2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\3_5.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\6_8.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align3.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align5.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align7.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align_s0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align_s1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align_s2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\zero.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_swap.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 3, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\datato\_double.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\div_align.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\mult_align.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 1, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\rmv_swap.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 3, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\add.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 2, 4, 20 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\div.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 2, 4, 20 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\inverse.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 2, 2, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\mult.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 2, 4, 20 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\rmv.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 2, 4, 20 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\sqrt.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 2, 2, 11 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\_double.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 1, 2, 11 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\-3_0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\-7_-4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\-7_8.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\1_4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\5_8.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\-1_0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\-4_-2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\1_2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\3_6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\zmult_align.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 1, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\init.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 3, 25 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\init_overworld.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, 1, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_chest.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_math.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_origin.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_return.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_sign.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_uuid.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\_new.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\_reid.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 5, 0, 13 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\get_newint.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\set.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_append.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 2, 3, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_cross.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 3, 18 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_diff.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 5, 3, 19 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_ex-tags.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 1, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_get.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_merge.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 3, 14 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_new.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 1, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_of.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 5, 3, 14 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_print.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 1, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_ssnew.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_ssprint.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 1, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_store.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_subset.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 16 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_swap.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1, 2, 10 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\append_success.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\cross_sloop.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 2, 0, 10 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\cross_success.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\diff_sloop.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 2, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\diff_success.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 0, 5 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\init.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 2, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\merge_sloop.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 2, 0, 9 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\merge_success.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\set.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\subset_sloop.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 2, 0, 8 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\tags_sloop.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 2, 0, 7 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\base.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 7, 40 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\cross.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 1, 5, 24 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\diff.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 1, 6, 26 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\ex-tags.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 1, 4, 15 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\merge.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 1, 6, 26 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\of.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 1, 4, 14 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\subset.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 1, 6, 28 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\_3self.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\_3sqrt.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\_self.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, 0, 17 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range3.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 1, 3, 25 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range4.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 1, 1, 20 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range5.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range6.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range7.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range8.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 1, 2, 24 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range9.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 1, 2, 22 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\rmv.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\_perf.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1, 2, 10 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_loop.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 5 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_print.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 1, 4, 36 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_ssnew.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 1, 5, 34 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_ssprint.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 1, 4, 31 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_start.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 1, 2, 12 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_std.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 1, 4, 33 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_tick.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 1, 2, 13 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\std_loop0.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 4 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\std_loop1.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 5 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\std_loop2.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 5 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\run.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 1, 1, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\tick.mcfunction", "mcfunction", 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 2, 6 +"g:\AST\MCFPP\mcfpp\math\src\math\pack.mcmeta", "JSON", 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 1, 7 +"g:\AST\MCFPP\mcfpp\sys\mcfpp.sys.json", "JSON", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8 +"g:\AST\MCFPP\settings.gradle.kts", "Kotlinscript", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 +"g:\AST\MCFPP\src\main\cpp\test.cpp", "C++", 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 2, 8 +"g:\AST\MCFPP\src\main\gen\mcfppLexer.java", "Java", 0, 0, 0, 0, 0, 0, 0, 1300, 0, 0, 4, 19, 1323 +"g:\AST\MCFPP\src\main\java\top\mcfpp\annotations\InsertCommand.java", "Java", 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 3, 12 +"g:\AST\MCFPP\src\main\java\top\mcfpp\annotations\MCFPPNative.java", "Java", 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 3, 12 +"g:\AST\MCFPP\src\main\java\top\mcfpp\jni\Test.java", "Java", 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 4, 14 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\MCAnyData.java", "Java", 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 2, 7, 36 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\MCIntData.java", "Java", 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 1, 8, 34 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTDictionaryData.java", "Java", 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 8, 34 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTListConcreteData.java", "Java", 0, 0, 0, 0, 0, 0, 0, 181, 0, 0, 15, 15, 211 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTListData.java", "Java", 0, 0, 0, 0, 0, 0, 0, 210, 0, 0, 11, 14, 235 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTMapData.java", "Java", 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 14, 58 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\Range.java", "Java", 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 11, 8, 32 +"g:\AST\MCFPP\src\main\java\top\mcfpp\lang\System.java", "Java", 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 10, 12, 83 +"g:\AST\MCFPP\src\main\java\top\mcfppdoc\antlr\McfppDocVisitor.java", "Java", 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 3, 7 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\CompileSettings.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 6, 2, 13 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\MCFPP.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 3, 3, 59 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\Project.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 116, 33, 390 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\annotations\MCFPNativeProcessor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 4, 28 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppErrorListener.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 3, 7 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppExprVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 505, 0, 0, 0, 120, 28, 653 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppFieldVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 641, 0, 0, 0, 162, 47, 850 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppFuncManager.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 35, 7, 106 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppGenericClassVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 9, 4, 71 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppImVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 763, 0, 0, 0, 235, 94, 1092 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppInlineFunctionVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 2, 5 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppLeftExprVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 184, 0, 0, 0, 38, 6, 228 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppTypeVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 180, 0, 0, 0, 65, 13, 258 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\NativeClassVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 73, 2, 78 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\Command.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 104, 0, 0, 0, 53, 23, 180 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\CommandList.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 7, 37 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\Commands.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 37, 12, 124 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\Comment.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 7, 24 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\package-info.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 2, 8 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\tree\CommandTreeModel.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 24, 4, 40 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\tree\DownloadHelper.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 291, 0, 0, 0, 29, 23, 343 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\commandline\LineCompiler.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 1, 8, 69 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\commandline\Main.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 3, 8, 83 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\CompileTimeFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 5, 5, 41 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\CompileTimeFunctionField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 5, 3, 29 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\JavaScriptInterpreter.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 3, 14 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\MCControl.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 2, 8 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\McfppCompileTimeVisitor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, 0, 24, 197 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\CommandException.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 4 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\IllegalFormatException.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 6 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\OperationNotImplementException.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 5, 10 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\UndefinedException.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 4 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\VariableConverseException.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 5, 10 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\VariableNotResolvedException.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 6 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\DatapackCreator.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 178, 0, 0, 0, 54, 8, 240 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\LibReader.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 41, 8, 290 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\LibWriter.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 169, 0, 0, 0, 26, 9, 204 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\MCFPPFile.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, 18, 14, 135 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\CanSelectMember.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 19, 5, 33 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ClassBase.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 19, 4, 39 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ClassObject.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 46, 15, 126 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ClassPointer.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, 70, 21, 221 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\CompoundDataType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 25, 10, 84 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Entity.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 127, 2, 142 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\INativeClass.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 9, 2, 20 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Indexable.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 3, 7 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\IntTemplateBase.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 3, 5, 15 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\IntTemplatePointer.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 27, 15, 87 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\IntTemplateType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 4, 11 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\JavaVar.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, 69, 23, 228 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\JsonString.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 87, 2, 99 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\JsonText.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 15, 12, 62 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCAny.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 119, 24, 271 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCBool.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 251, 0, 0, 0, 53, 37, 341 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCFPPTypeVar.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 15, 71 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCFloat.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 576, 0, 0, 0, 210, 57, 843 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCInt.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 565, 0, 0, 0, 96, 51, 712 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCNumber.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 86, 22, 151 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCString.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 118, 0, 0, 0, 59, 20, 197 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTAny.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 147, 1, 149 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTBasedData.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 518, 0, 0, 0, 116, 46, 680 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTDictionary.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 56, 24, 226 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTList.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 151, 0, 0, 0, 53, 26, 230 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTMap.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 40, 12, 119 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTTemplateBase.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 4 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTTemplatePointer.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 4 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTTemplateType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 4 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\OnScoreboard.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 3, 1, 8 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Range.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 1, 5 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ReturnedMCBool.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 22, 7, 57 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\SbObject.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 20, 13, 76 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Selector.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 158, 3, 178 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Storage.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 5, 8, 39 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\UnknownVar.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 27, 13, 65 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\UnresolvedVar.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 56, 16, 123 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Var.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 179, 0, 0, 0, 149, 43, 371 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Void.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 27, 11, 85 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\annotation\Inject.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 2, 6, 30 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPBaseType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 18, 7, 86 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPClassType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 22, 11, 99 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPGenericClassType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 4, 13 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPGenericType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 17, 4, 34 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPNBTType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 17, 16, 79 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPTemplateType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 4, 7, 33 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, 56, 26, 237 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\value\MCFPPTypeValue.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 8, 12, 66 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\value\MCFPPValue.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 7, 3, 18 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lib\ConstantPool.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 4, 8 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lib\MacroFunctionGenerator.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 4 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Annotation.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 25, 12, 78 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Class.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 104, 0, 0, 0, 87, 26, 217 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\CompoundData.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 104, 0, 0, 0, 63, 19, 186 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\FieldContainer.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 7, 1, 12 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Interface.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 12, 5, 31 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Member.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 21, 6, 37 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Native.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 3 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\NativeClass.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 3, 4, 20 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Template.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 34, 13, 104 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\UnknownClass.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 2, 5 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\CompoundDataField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 122, 0, 0, 0, 46, 28, 196 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\FileField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 3 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\FunctionField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 57, 25, 188 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\GlobalField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 263, 0, 0, 0, 71, 21, 355 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 20, 3, 26 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithClass.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 36, 8, 54 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 17, 6, 32 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithInterface.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 32, 8, 50 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithTemplate.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 32, 7, 51 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 27, 8, 45 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithVar.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 27, 8, 45 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\InternalFunctionField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 20, 10, 81 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\NamespaceField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 185, 0, 0, 0, 160, 42, 387 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\NoStackFunctionField.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 5, 4, 20 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\SimpleFieldWithFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 13, 9, 61 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\SimpleFieldWithType.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 3, 9, 47 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\SimpleFieldWithVar.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 30, 9, 76 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\Constructor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 108, 0, 0, 0, 26, 9, 143 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\ExtensionFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 14, 7, 61 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\Function.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 375, 72, 927 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\FunctionParam.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, 32, 15, 121 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\FunctionTag.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 12, 8, 67 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\InlineFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 50, 11, 99 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\InternalFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 28, 6, 58 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\JavaFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 2, 6, 25 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\NativeConstructor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 2, 13 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\NativeFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 57, 18, 137 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\NoStackFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 4, 12 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\TemplateConstructor.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 1, 4, 27 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\UnknownFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 5, 3, 21 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\Generic.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 10, 26 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\GenericClass.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 13, 17, 77 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\GenericExtensionFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 118, 0, 0, 0, 15, 13, 146 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\GenericFunction.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 141, 0, 0, 0, 29, 15, 185 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\package-info.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 2, 6 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\package-info.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 3 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\AntlrUtil.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 4, 22 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\AnyTag.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 5, 5, 21 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\LazyWrapper.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 11, 9, 51 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\LogProcesser.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 11, 47 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\MCUUID.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 7, 27 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\MacroHelper.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 5, 4, 21 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\NBTUtil.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 105, 0, 0, 0, 5, 16, 126 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\ResourceLocation.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 17, 5, 44 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\StringHelper.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 5, 4, 43 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\Utils.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 10, 16, 86 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\UwU.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 4, 4, 74 +"g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\ValueWrapper.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 3 +"g:\AST\MCFPP\src\test\java\top\mcfpp\test\GenericsTest.java", "Java", 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 10, 51 +"g:\AST\MCFPP\src\test\java\top\mcfpp\test\NativeTest.java", "Java", 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3, 11 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\CommandTreeDeserializeTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 5, 97 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\CompileTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 113, 0, 0, 0, 0, 16, 129 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\CompileTimeTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 1, 3, 40 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\FloatTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 3, 22 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\JavaScriptInterpreterTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 4, 13 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\MCFPPStringTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 16, 3, 117 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NBTAnyDataTypeTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 4, 22 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NBTTest.kts", "Kotlinscript", 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NashornTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 3, 15 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NativeTest1.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 3, 20 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\StringCompileTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 4, 17 +"g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\StringTest.kt", "Kotlin", 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 4, 18 +"g:\AST\MCFPP\test\Test.json", "JSON", 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 8 +"Total", "-", 172, 6, 86, 39, 284, 6, 11777, 1968, 2517, 251, 5533, 2324, 24963 \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/results.json b/.VSCodeCounter/2024-05-14_19-40-04/results.json new file mode 100644 index 00000000..caa71f43 --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/results.json @@ -0,0 +1 @@ +{"file:///g%3A/AST/MCFPP/TODO_CN.md":{"language":"Markdown","code":24,"comment":0,"blank":5},"file:///g%3A/AST/MCFPP/gradle.properties":{"language":"Properties","code":1,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/build.gradle.kts":{"language":"Kotlinscript","code":82,"comment":0,"blank":14},"file:///g%3A/AST/MCFPP/gradlew.bat":{"language":"Batch","code":39,"comment":29,"blank":22},"file:///g%3A/AST/MCFPP/TODO.md":{"language":"Markdown","code":24,"comment":0,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/sys/mcfpp.sys.json":{"language":"JSON","code":8,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/settings.gradle.kts":{"language":"Kotlinscript","code":1,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/cpp/test.cpp":{"language":"C++","code":6,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/README_CN.md":{"language":"Markdown","code":59,"comment":0,"blank":10},"file:///g%3A/AST/MCFPP/README.md":{"language":"Markdown","code":59,"comment":0,"blank":10},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/MCUUID.kt":{"language":"Kotlin","code":20,"comment":0,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/LogProcesser.kt":{"language":"Kotlin","code":36,"comment":0,"blank":11},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/Project.kt":{"language":"Kotlin","code":241,"comment":116,"blank":33},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/MCFPP.kt":{"language":"Kotlin","code":53,"comment":3,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/package-info.kt":{"language":"Kotlin","code":1,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/LazyWrapper.kt":{"language":"Kotlin","code":31,"comment":11,"blank":9},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/MacroHelper.kt":{"language":"Kotlin","code":12,"comment":5,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/AnyTag.kt":{"language":"Kotlin","code":11,"comment":5,"blank":5},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/AntlrUtil.kt":{"language":"Kotlin","code":18,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/Template.kt":{"language":"Kotlin","code":57,"comment":34,"blank":13},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/NativeClass.kt":{"language":"Kotlin","code":13,"comment":3,"blank":4},"file:///g%3A/AST/MCFPP/src/main/gen/mcfppLexer.java":{"language":"Java","code":1300,"comment":4,"blank":19},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/package-info.kt":{"language":"Kotlin","code":1,"comment":3,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/Native.kt":{"language":"Kotlin","code":2,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/Member.kt":{"language":"Kotlin","code":10,"comment":21,"blank":6},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lib/MacroFunctionGenerator.kt":{"language":"Kotlin","code":2,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/Interface.kt":{"language":"Kotlin","code":14,"comment":12,"blank":5},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfppdoc/antlr/McfppDocVisitor.java":{"language":"Java","code":4,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lib/ConstantPool.kt":{"language":"Kotlin","code":4,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/ValueWrapper.kt":{"language":"Kotlin","code":2,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/UwU.kt":{"language":"Kotlin","code":66,"comment":4,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/UnknownClass.kt":{"language":"Kotlin","code":3,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/Utils.kt":{"language":"Kotlin","code":60,"comment":10,"blank":16},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/StringHelper.kt":{"language":"Kotlin","code":34,"comment":5,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/ResourceLocation.kt":{"language":"Kotlin","code":22,"comment":17,"blank":5},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/util/NBTUtil.kt":{"language":"Kotlin","code":105,"comment":5,"blank":16},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/FieldContainer.kt":{"language":"Kotlin","code":4,"comment":7,"blank":1},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/jni/Test.java":{"language":"Java","code":10,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/CompoundData.kt":{"language":"Kotlin","code":104,"comment":63,"blank":19},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/MCIntData.java":{"language":"Java","code":25,"comment":1,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/Annotation.kt":{"language":"Kotlin","code":41,"comment":25,"blank":12},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/MCAnyData.java":{"language":"Java","code":27,"comment":2,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/Class.kt":{"language":"Kotlin","code":104,"comment":87,"blank":26},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/annotations/InsertCommand.java":{"language":"Java","code":9,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/annotations/MCFPPNative.java":{"language":"Java","code":9,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/NBTDictionaryData.java":{"language":"Java","code":26,"comment":0,"blank":8},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/System.java":{"language":"Java","code":61,"comment":10,"blank":12},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/generic/GenericFunction.kt":{"language":"Kotlin","code":141,"comment":29,"blank":15},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/Range.java":{"language":"Java","code":13,"comment":11,"blank":8},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/NBTMapData.java":{"language":"Java","code":44,"comment":0,"blank":14},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/generic/GenericExtensionFunction.kt":{"language":"Kotlin","code":118,"comment":15,"blank":13},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/NBTListData.java":{"language":"Java","code":210,"comment":11,"blank":14},"file:///g%3A/AST/MCFPP/src/main/java/top/mcfpp/lang/NBTListConcreteData.java":{"language":"Java","code":181,"comment":15,"blank":15},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/generic/GenericClass.kt":{"language":"Kotlin","code":47,"comment":13,"blank":17},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/IFieldWithInterface.kt":{"language":"Kotlin","code":10,"comment":32,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/generic/Generic.kt":{"language":"Kotlin","code":16,"comment":0,"blank":10},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/IFieldWithFunction.kt":{"language":"Kotlin","code":9,"comment":17,"blank":6},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithVar.kt":{"language":"Kotlin","code":37,"comment":30,"blank":9},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/CanSelectMember.kt":{"language":"Kotlin","code":9,"comment":19,"blank":5},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/InlineFunction.kt":{"language":"Kotlin","code":38,"comment":50,"blank":11},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/IntTemplatePointer.kt":{"language":"Kotlin","code":45,"comment":27,"blank":15},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/JavaVar.kt":{"language":"Kotlin","code":136,"comment":69,"blank":23},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/NativeFunction.kt":{"language":"Kotlin","code":62,"comment":57,"blank":18},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/IntTemplateBase.kt":{"language":"Kotlin","code":7,"comment":3,"blank":5},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/TemplateConstructor.kt":{"language":"Kotlin","code":22,"comment":1,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/Indexable.kt":{"language":"Kotlin","code":4,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/NoStackFunction.kt":{"language":"Kotlin","code":8,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithType.kt":{"language":"Kotlin","code":35,"comment":3,"blank":9},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/NativeConstructor.kt":{"language":"Kotlin","code":11,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/INativeClass.kt":{"language":"Kotlin","code":9,"comment":9,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/Entity.kt":{"language":"Kotlin","code":13,"comment":127,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/JsonString.kt":{"language":"Kotlin","code":10,"comment":87,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/SimpleFieldWithFunction.kt":{"language":"Kotlin","code":39,"comment":13,"blank":9},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTAny.kt":{"language":"Kotlin","code":1,"comment":147,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/UnknownFunction.kt":{"language":"Kotlin","code":13,"comment":5,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/MCNumber.kt":{"language":"Kotlin","code":43,"comment":86,"blank":22},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/JsonText.kt":{"language":"Kotlin","code":35,"comment":15,"blank":12},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/IntTemplateType.kt":{"language":"Kotlin","code":7,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/MCString.kt":{"language":"Kotlin","code":118,"comment":59,"blank":20},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/MCFPPTypeVar.kt":{"language":"Kotlin","code":56,"comment":0,"blank":15},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/MCInt.kt":{"language":"Kotlin","code":565,"comment":96,"blank":51},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/MCFloat.kt":{"language":"Kotlin","code":576,"comment":210,"blank":57},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/MCBool.kt":{"language":"Kotlin","code":251,"comment":53,"blank":37},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/MCAny.kt":{"language":"Kotlin","code":128,"comment":119,"blank":24},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTBasedData.kt":{"language":"Kotlin","code":518,"comment":116,"blank":46},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/Var.kt":{"language":"Kotlin","code":179,"comment":149,"blank":43},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/io/MCFPPFile.kt":{"language":"Kotlin","code":103,"comment":18,"blank":14},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/Void.kt":{"language":"Kotlin","code":47,"comment":27,"blank":11},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/UnresolvedVar.kt":{"language":"Kotlin","code":51,"comment":56,"blank":16},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/io/LibWriter.kt":{"language":"Kotlin","code":169,"comment":26,"blank":9},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/UnknownVar.kt":{"language":"Kotlin","code":25,"comment":27,"blank":13},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/io/LibReader.kt":{"language":"Kotlin","code":241,"comment":41,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/io/DatapackCreator.kt":{"language":"Kotlin","code":178,"comment":54,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/Selector.kt":{"language":"Kotlin","code":17,"comment":158,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/Storage.kt":{"language":"Kotlin","code":26,"comment":5,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/exception/VariableNotResolvedException.kt":{"language":"Kotlin","code":3,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/InternalFunction.kt":{"language":"Kotlin","code":24,"comment":28,"blank":6},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/exception/VariableConverseException.kt":{"language":"Kotlin","code":5,"comment":0,"blank":5},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunction.kt":{"language":"Kotlin","code":31,"comment":5,"blank":5},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/exception/UndefinedException.kt":{"language":"Kotlin","code":3,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/exception/OperationNotImplementException.kt":{"language":"Kotlin","code":5,"comment":0,"blank":5},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/exception/CommandException.kt":{"language":"Kotlin","code":3,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/SbObject.kt":{"language":"Kotlin","code":43,"comment":20,"blank":13},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/exception/IllegalFormatException.kt":{"language":"Kotlin","code":3,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/Range.kt":{"language":"Kotlin","code":1,"comment":3,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/OnScoreboard.kt":{"language":"Kotlin","code":4,"comment":3,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTTemplateType.kt":{"language":"Kotlin","code":3,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTTemplatePointer.kt":{"language":"Kotlin","code":3,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTTemplateBase.kt":{"language":"Kotlin","code":3,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTDictionary.kt":{"language":"Kotlin","code":146,"comment":56,"blank":24},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTMap.kt":{"language":"Kotlin","code":67,"comment":40,"blank":12},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/NoStackFunctionField.kt":{"language":"Kotlin","code":11,"comment":5,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/JavaFunction.kt":{"language":"Kotlin","code":17,"comment":2,"blank":6},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/CompoundDataType.kt":{"language":"Kotlin","code":49,"comment":25,"blank":10},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunctionField.kt":{"language":"Kotlin","code":21,"comment":5,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/NamespaceField.kt":{"language":"Kotlin","code":185,"comment":160,"blank":42},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/NBTList.kt":{"language":"Kotlin","code":151,"comment":53,"blank":26},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/IFieldWithVar.kt":{"language":"Kotlin","code":10,"comment":27,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/InternalFunctionField.kt":{"language":"Kotlin","code":51,"comment":20,"blank":10},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/ClassObject.kt":{"language":"Kotlin","code":65,"comment":46,"blank":15},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/ClassPointer.kt":{"language":"Kotlin","code":130,"comment":70,"blank":21},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/IFieldWithType.kt":{"language":"Kotlin","code":10,"comment":27,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/ClassBase.kt":{"language":"Kotlin","code":16,"comment":19,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/IFieldWithTemplate.kt":{"language":"Kotlin","code":12,"comment":32,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/IFieldWithClass.kt":{"language":"Kotlin","code":10,"comment":36,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/FunctionParam.kt":{"language":"Kotlin","code":74,"comment":32,"blank":15},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/FunctionTag.kt":{"language":"Kotlin","code":47,"comment":12,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/IField.kt":{"language":"Kotlin","code":3,"comment":20,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/FunctionField.kt":{"language":"Kotlin","code":106,"comment":57,"blank":25},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/ExtensionFunction.kt":{"language":"Kotlin","code":40,"comment":14,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/FileField.kt":{"language":"Kotlin","code":2,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/GlobalField.kt":{"language":"Kotlin","code":263,"comment":71,"blank":21},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/Constructor.kt":{"language":"Kotlin","code":108,"comment":26,"blank":9},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/compiletime/JavaScriptInterpreter.kt":{"language":"Kotlin","code":11,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/CompileSettings.kt":{"language":"Kotlin","code":5,"comment":6,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/field/CompoundDataField.kt":{"language":"Kotlin","code":122,"comment":46,"blank":28},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/type/MCFPPType.kt":{"language":"Kotlin","code":155,"comment":56,"blank":26},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/annotation/Inject.kt":{"language":"Kotlin","code":22,"comment":2,"blank":6},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/compiletime/MCControl.kt":{"language":"Kotlin","code":6,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/compiletime/McfppCompileTimeVisitor.kt":{"language":"Kotlin","code":173,"comment":0,"blank":24},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/type/MCFPPNBTType.kt":{"language":"Kotlin","code":46,"comment":17,"blank":16},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/type/MCFPPTemplateType.kt":{"language":"Kotlin","code":22,"comment":4,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/type/MCFPPGenericType.kt":{"language":"Kotlin","code":13,"comment":17,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/type/MCFPPBaseType.kt":{"language":"Kotlin","code":61,"comment":18,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/type/MCFPPClassType.kt":{"language":"Kotlin","code":66,"comment":22,"blank":11},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/type/MCFPPGenericClassType.kt":{"language":"Kotlin","code":9,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/commandline/Main.kt":{"language":"Kotlin","code":72,"comment":3,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/commandline/LineCompiler.kt":{"language":"Kotlin","code":60,"comment":1,"blank":8},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/value/MCFPPTypeValue.kt":{"language":"Kotlin","code":46,"comment":8,"blank":12},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppTypeVisitor.kt":{"language":"Kotlin","code":180,"comment":65,"blank":13},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/value/MCFPPValue.kt":{"language":"Kotlin","code":8,"comment":7,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppLeftExprVisitor.kt":{"language":"Kotlin","code":184,"comment":38,"blank":6},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppInlineFunctionVisitor.kt":{"language":"Kotlin","code":3,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/command/package-info.kt":{"language":"Kotlin","code":1,"comment":5,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassVisitor.kt":{"language":"Kotlin","code":58,"comment":9,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppFuncManager.kt":{"language":"Kotlin","code":64,"comment":35,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/command/Comment.kt":{"language":"Kotlin","code":17,"comment":0,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/NativeClassVisitor.kt":{"language":"Kotlin","code":3,"comment":73,"blank":2},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/model/function/Function.kt":{"language":"Kotlin","code":480,"comment":375,"blank":72},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/lang/ReturnedMCBool.kt":{"language":"Kotlin","code":28,"comment":22,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppImVisitor.kt":{"language":"Kotlin","code":763,"comment":235,"blank":94},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppExprVisitor.kt":{"language":"Kotlin","code":505,"comment":120,"blank":28},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/command/Commands.kt":{"language":"Kotlin","code":75,"comment":37,"blank":12},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/command/CommandList.kt":{"language":"Kotlin","code":30,"comment":0,"blank":7},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/command/Command.kt":{"language":"Kotlin","code":104,"comment":53,"blank":23},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/command/tree/CommandTreeModel.kt":{"language":"Kotlin","code":12,"comment":24,"blank":4},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppFieldVisitor.kt":{"language":"Kotlin","code":641,"comment":162,"blank":47},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/antlr/McfppErrorListener.kt":{"language":"Kotlin","code":4,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/annotations/MCFPNativeProcessor.kt":{"language":"Kotlin","code":24,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/test/Test.json":{"language":"JSON","code":8,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/src/main/kotlin/top/mcfpp/command/tree/DownloadHelper.kt":{"language":"Kotlin","code":291,"comment":29,"blank":23},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/pack.mcmeta":{"language":"JSON","code":6,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/README.md":{"language":"Markdown","code":6,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/gradle/wrapper/gradle-wrapper.properties":{"language":"Properties","code":5,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/MCFPPStringTest.kt":{"language":"Kotlin","code":98,"comment":16,"blank":3},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/NativeTest1.kt":{"language":"Kotlin","code":17,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/NashornTest.kt":{"language":"Kotlin","code":12,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/JavaScriptInterpreterTest.kt":{"language":"Kotlin","code":9,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/FloatTest.kt":{"language":"Kotlin","code":19,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/CompileTest.kt":{"language":"Kotlin","code":113,"comment":0,"blank":16},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/CompileTimeTest.kt":{"language":"Kotlin","code":36,"comment":1,"blank":3},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/CommandTreeDeserializeTest.kt":{"language":"Kotlin","code":92,"comment":0,"blank":5},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/StringTest.kt":{"language":"Kotlin","code":14,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/mcfpp.math.json":{"language":"JSON","code":8,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/StringCompileTest.kt":{"language":"Kotlin","code":13,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/NBTTest.kts":{"language":"Kotlinscript","code":3,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/src/test/java/top/mcfpp/test/GenericsTest.java":{"language":"Java","code":41,"comment":0,"blank":10},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_xyz.mcfunction":{"language":"mcfunction","code":4,"comment":5,"blank":0},"file:///g%3A/AST/MCFPP/log4j2.xml":{"language":"XML","code":13,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/tick.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/.idea/misc.xml":{"language":"XML","code":43,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/mcfpp.dynamic.json":{"language":"JSON","code":8,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/_4div.mcfunction":{"language":"mcfunction","code":16,"comment":4,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/_3div.mcfunction":{"language":"mcfunction","code":15,"comment":4,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen4.json":{"language":"JSON","code":25,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/.idea/kotlinScripting.xml":{"language":"XML","code":0,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/.idea/vcs.xml":{"language":"XML","code":6,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/.idea/gradle.xml":{"language":"XML","code":17,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/src/test/kotlin/top/mcfpp/test/NBTAnyDataTypeTest.kt":{"language":"Kotlin","code":18,"comment":0,"blank":4},"file:///g%3A/AST/MCFPP/src/test/java/top/mcfpp/test/NativeTest.java":{"language":"Java","code":8,"comment":0,"blank":3},"file:///g%3A/AST/MCFPP/.idea/kotlinc.xml":{"language":"XML","code":6,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/init.mcfunction":{"language":"mcfunction","code":18,"comment":4,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen3.json":{"language":"JSON","code":26,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen1.json":{"language":"JSON","code":17,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls8.json":{"language":"JSON","code":8,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls9.json":{"language":"JSON","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen2.json":{"language":"JSON","code":25,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls7.json":{"language":"JSON","code":8,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls6.json":{"language":"JSON","code":15,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls5.json":{"language":"JSON","code":10,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls4.json":{"language":"JSON","code":9,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls3.json":{"language":"JSON","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls2.json":{"language":"JSON","code":12,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls16.json":{"language":"JSON","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls15.json":{"language":"JSON","code":9,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls13.json":{"language":"JSON","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls14.json":{"language":"JSON","code":12,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls12.json":{"language":"JSON","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls11.json":{"language":"JSON","code":12,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls10.json":{"language":"JSON","code":9,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls1.json":{"language":"JSON","code":8,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/.idea/statistic.xml":{"language":"XML","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_mult.mcfunction":{"language":"mcfunction","code":19,"comment":6,"blank":3},"file:///g%3A/AST/MCFPP/.idea/encodings.xml":{"language":"XML","code":9,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_issmallerorequal.mcfunction":{"language":"mcfunction","code":5,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_isbiggerorequal.mcfunction":{"language":"mcfunction","code":5,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_issmaller.mcfunction":{"language":"mcfunction","code":5,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_isbigger.mcfunction":{"language":"mcfunction","code":5,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_notequal.mcfunction":{"language":"mcfunction","code":5,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_inverse.mcfunction":{"language":"mcfunction","code":31,"comment":5,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_get.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_div.mcfunction":{"language":"mcfunction","code":34,"comment":7,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_cmp.mcfunction":{"language":"mcfunction","code":11,"comment":2,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_equal.mcfunction":{"language":"mcfunction","code":5,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_add.mcfunction":{"language":"mcfunction","code":24,"comment":7,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_rmv.mcfunction":{"language":"mcfunction","code":24,"comment":7,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/zmult_align.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_ssrandnew.mcfunction":{"language":"mcfunction","code":16,"comment":2,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_store.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/.idea/inspectionProfiles/Project_Default.xml":{"language":"XML","code":6,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_ssprint.mcfunction":{"language":"mcfunction","code":7,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_sqrt.mcfunction":{"language":"mcfunction","code":14,"comment":4,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_sqr.mcfunction":{"language":"mcfunction","code":17,"comment":6,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_zsqr.mcfunction":{"language":"mcfunction","code":17,"comment":6,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_scoreto.mcfunction":{"language":"mcfunction","code":10,"comment":5,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/pack.mcmeta":{"language":"JSON","code":6,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_toscore.mcfunction":{"language":"mcfunction","code":8,"comment":1,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/rmv_swap.mcfunction":{"language":"mcfunction","code":5,"comment":1,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/mult_align.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/_swap.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/div_align.mcfunction":{"language":"mcfunction","code":7,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapx.mcfunction":{"language":"mcfunction","code":5,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapy.mcfunction":{"language":"mcfunction","code":5,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignz.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignx.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapz.mcfunction":{"language":"mcfunction","code":5,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_aligny.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapz.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapy.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapx.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align5.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_cross.mcfunction":{"language":"mcfunction","code":101,"comment":2,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_add.mcfunction":{"language":"mcfunction","code":74,"comment":19,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align6.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_div.mcfunction":{"language":"mcfunction","code":90,"comment":19,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align4.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/3_6.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align3.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/1_2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align1.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-1_0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/zero.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-4_-2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s0.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s1.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align7.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-4_-2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_vecto.mcfunction":{"language":"mcfunction","code":30,"comment":13,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-1_0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/3_6.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/1_2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/.idea/uiDesigner.xml":{"language":"XML","code":124,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_swap.mcfunction":{"language":"mcfunction","code":12,"comment":1,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_unit.mcfunction":{"language":"mcfunction","code":20,"comment":2,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_tovec.mcfunction":{"language":"mcfunction","code":24,"comment":4,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_store.mcfunction":{"language":"mcfunction","code":12,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintx.mcfunction":{"language":"mcfunction","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprinty.mcfunction":{"language":"mcfunction","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssrandnew.mcfunction":{"language":"mcfunction","code":22,"comment":2,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintz.mcfunction":{"language":"mcfunction","code":7,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_mult.mcfunction":{"language":"mcfunction","code":57,"comment":13,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_length.mcfunction":{"language":"mcfunction","code":18,"comment":2,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_dot.mcfunction":{"language":"mcfunction","code":125,"comment":29,"blank":6},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_get.mcfunction":{"language":"mcfunction","code":12,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_rmv.mcfunction":{"language":"mcfunction","code":72,"comment":19,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/datato/_double.mcfunction":{"language":"mcfunction","code":1,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/todata/_double.mcfunction":{"language":"mcfunction","code":8,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprint.mcfunction":{"language":"mcfunction","code":22,"comment":1,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/test/mult.mcfunction":{"language":"mcfunction","code":14,"comment":2,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/test/sqrt.mcfunction":{"language":"mcfunction","code":7,"comment":2,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/test/inverse.mcfunction":{"language":"mcfunction","code":8,"comment":2,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/test/div.mcfunction":{"language":"mcfunction","code":14,"comment":2,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/test/add.mcfunction":{"language":"mcfunction","code":14,"comment":2,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/function.mcfunction":{"language":"mcfunction","code":1,"comment":3,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_swap.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/test/rmv.mcfunction":{"language":"mcfunction","code":14,"comment":2,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/5_8.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/1_4.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_8.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_-4.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-3_0.mcfunction":{"language":"mcfunction","code":4,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3div_resign.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/z_join.mcfunction":{"language":"mcfunction","code":1,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/append_number_index.mcfunction":{"language":"mcfunction","code":1,"comment":2,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_version.mcfunction":{"language":"mcfunction","code":2,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/join_path.mcfunction":{"language":"mcfunction","code":6,"comment":5,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_topos.mcfunction":{"language":"mcfunction","code":3,"comment":4,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/6_8.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/3_5.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align1.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_sqrt.mcfunction":{"language":"mcfunction","code":16,"comment":4,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/1_2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/.idea/codeStyles/Project.xml":{"language":"XML","code":15,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/zero.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/.idea/codeStyles/codeStyleConfig.xml":{"language":"XML","code":5,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s0.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s1.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align6.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align5.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align4.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align7.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align3.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_sincos.mcfunction":{"language":"mcfunction","code":4,"comment":5,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_refacing.mcfunction":{"language":"mcfunction","code":7,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only_with_criterion.mcfunction":{"language":"mcfunction","code":1,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only.mcfunction":{"language":"mcfunction","code":1,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/multi.mcfunction":{"language":"mcfunction","code":1,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_random.mcfunction":{"language":"mcfunction","code":8,"comment":4,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/everything.mcfunction":{"language":"mcfunction","code":1,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-4_-2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/1_2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/3_6.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-1_0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get_scale.mcfunction":{"language":"mcfunction","code":1,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_posto.mcfunction":{"language":"mcfunction","code":3,"comment":4,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/3_6.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get.mcfunction":{"language":"mcfunction","code":1,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/1_2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-4_-2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-1_0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp.mcfunction":{"language":"mcfunction","code":1,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage.mcfunction":{"language":"mcfunction","code":1,"comment":3,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/_init.mcfunction":{"language":"mcfunction","code":59,"comment":14,"blank":14},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/modifier/add.mcfunction":{"language":"mcfunction","code":0,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align3.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align1.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp6.mcfunction":{"language":"mcfunction","code":1,"comment":3,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align4.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/new.mcfunction":{"language":"mcfunction","code":21,"comment":2,"blank":6},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp4.mcfunction":{"language":"mcfunction","code":1,"comment":3,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage.mcfunction":{"language":"mcfunction","code":1,"comment":3,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp2.mcfunction":{"language":"mcfunction","code":1,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align5.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/main.mcfunction":{"language":"mcfunction","code":13,"comment":2,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp5.mcfunction":{"language":"mcfunction","code":1,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp3.mcfunction":{"language":"mcfunction","code":1,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/length.mcfunction":{"language":"mcfunction","code":6,"comment":2,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align0.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align1.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align6.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.append.from.entity_sp.mcfunction":{"language":"mcfunction","code":1,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align7.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s0.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align6.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s1.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/zero.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align4.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align5.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s1.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/zero.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align3.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align7.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align2.mcfunction":{"language":"mcfunction","code":2,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s0.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/init_overworld.mcfunction":{"language":"mcfunction","code":5,"comment":6,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/_start.mcfunction":{"language":"mcfunction","code":9,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/_perf.mcfunction":{"language":"mcfunction","code":7,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/run.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/_ssnew.mcfunction":{"language":"mcfunction","code":28,"comment":1,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/_ssprint.mcfunction":{"language":"mcfunction","code":26,"comment":1,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/_print.mcfunction":{"language":"mcfunction","code":31,"comment":1,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/_tick.mcfunction":{"language":"mcfunction","code":10,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/_loop.mcfunction":{"language":"mcfunction","code":3,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/_std.mcfunction":{"language":"mcfunction","code":28,"comment":1,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/std_loop1.mcfunction":{"language":"mcfunction","code":3,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/std_loop2.mcfunction":{"language":"mcfunction","code":3,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/append_success.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/test/perf/std_loop0.mcfunction":{"language":"mcfunction","code":2,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/_3self.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/_3sqrt.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/_self.mcfunction":{"language":"mcfunction","code":16,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/cross_sloop.mcfunction":{"language":"mcfunction","code":8,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/rmv.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range8.mcfunction":{"language":"mcfunction","code":21,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range9.mcfunction":{"language":"mcfunction","code":19,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range7.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range6.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/cross_success.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range5.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range3.mcfunction":{"language":"mcfunction","code":21,"comment":1,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range4.mcfunction":{"language":"mcfunction","code":18,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range2.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_print.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range0.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/marker/_uuid.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_of.mcfunction":{"language":"mcfunction","code":6,"comment":5,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/classify/new_group.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/marker/_sign.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_new.mcfunction":{"language":"mcfunction","code":3,"comment":3,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/sqrt/range1.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/marker/_return.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/obj_entity/_reid.mcfunction":{"language":"mcfunction","code":8,"comment":5,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_get.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_ssnew.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_merge.mcfunction":{"language":"mcfunction","code":7,"comment":4,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/classify/sloop.mcfunction":{"language":"mcfunction","code":7,"comment":3,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/obj_entity/_new.mcfunction":{"language":"mcfunction","code":1,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/marker/_origin.mcfunction":{"language":"mcfunction","code":1,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_ex-tags.mcfunction":{"language":"mcfunction","code":4,"comment":2,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_diff.mcfunction":{"language":"mcfunction","code":11,"comment":5,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/obj_entity/set.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_cross.mcfunction":{"language":"mcfunction","code":11,"comment":4,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/marker/_math.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/marker/_chest.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_append.mcfunction":{"language":"mcfunction","code":7,"comment":2,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/obj_entity/get_newint.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/tags_sloop.mcfunction":{"language":"mcfunction","code":5,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_ssprint.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/classify/_append.mcfunction":{"language":"mcfunction","code":5,"comment":3,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/subset_sloop.mcfunction":{"language":"mcfunction","code":6,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/merge_success.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_coordto.mcfunction":{"language":"mcfunction","code":4,"comment":5,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/init.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/set.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/merge_sloop.mcfunction":{"language":"mcfunction","code":7,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/diff_success.mcfunction":{"language":"mcfunction","code":4,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/diff_sloop.mcfunction":{"language":"mcfunction","code":7,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/init.mcfunction":{"language":"mcfunction","code":6,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_tosto.mcfunction":{"language":"mcfunction","code":7,"comment":4,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_tofpos.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_topos.mcfunction":{"language":"mcfunction","code":6,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_ssrandnew.mcfunction":{"language":"mcfunction","code":8,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_tofacing.mcfunction":{"language":"mcfunction","code":4,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_store.mcfunction":{"language":"mcfunction","code":6,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_ssprint.mcfunction":{"language":"mcfunction","code":1,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_print.mcfunction":{"language":"mcfunction","code":1,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_ldsp.mcfunction":{"language":"mcfunction","code":22,"comment":4,"blank":3},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_posto.mcfunction":{"language":"mcfunction","code":6,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_polar.mcfunction":{"language":"mcfunction","code":27,"comment":14,"blank":7},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_ldsp-ex.mcfunction":{"language":"mcfunction","code":2,"comment":4,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_get.mcfunction":{"language":"mcfunction","code":6,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_fposto.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_facingto.mcfunction":{"language":"mcfunction","code":4,"comment":2,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_ex-xyz.mcfunction":{"language":"mcfunction","code":30,"comment":8,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_ex-rot.mcfunction":{"language":"mcfunction","code":27,"comment":10,"blank":6},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_ex-len.mcfunction":{"language":"mcfunction","code":30,"comment":4,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_dsp-ex.mcfunction":{"language":"mcfunction","code":2,"comment":4,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_dsp.mcfunction":{"language":"mcfunction","code":23,"comment":4,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_swap.mcfunction":{"language":"mcfunction","code":7,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/classify/_ssnew.mcfunction":{"language":"mcfunction","code":2,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/_cross.mcfunction":{"language":"mcfunction","code":20,"comment":1,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_subset.mcfunction":{"language":"mcfunction","code":8,"comment":4,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/_store.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/test/ex-tags.mcfunction":{"language":"mcfunction","code":10,"comment":1,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/test/base.mcfunction":{"language":"mcfunction","code":32,"comment":1,"blank":7},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/test/diff.mcfunction":{"language":"mcfunction","code":19,"comment":1,"blank":6},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/test/of.mcfunction":{"language":"mcfunction","code":9,"comment":1,"blank":4},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/test/merge.mcfunction":{"language":"mcfunction","code":19,"comment":1,"blank":6},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/exlen/range2.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/test/cross.mcfunction":{"language":"mcfunction","code":18,"comment":1,"blank":5},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/set/test/subset.mcfunction":{"language":"mcfunction","code":21,"comment":1,"blank":6},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop1.mcfunction":{"language":"mcfunction","code":6,"comment":0,"blank":1},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/dsp/arrow.mcfunction":{"language":"mcfunction","code":124,"comment":0,"blank":24},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop0.mcfunction":{"language":"mcfunction","code":21,"comment":0,"blank":2},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/exlen/range1.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/exlen/range0.mcfunction":{"language":"mcfunction","code":3,"comment":0,"blank":0},"file:///g%3A/AST/MCFPP/mcfpp/math/src/math/data/math/functions/3vec/exlen/3div.mcfunction":{"language":"mcfunction","code":3,"comment":1,"blank":0}} \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/results.md b/.VSCodeCounter/2024-05-14_19-40-04/results.md new file mode 100644 index 00000000..0805ddad --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/results.md @@ -0,0 +1,151 @@ +# Summary + +Date : 2024-05-14 19:40:04 + +Directory g:\\AST\\MCFPP + +Total : 498 files, 17106 codes, 5533 comments, 2324 blanks, all 24963 lines + +Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) + +## Languages +| language | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| Kotlin | 158 | 11,777 | 4,924 | 1,772 | 18,473 | +| mcfunction | 275 | 2,517 | 524 | 342 | 3,383 | +| Java | 15 | 1,968 | 54 | 131 | 2,153 | +| JSON | 26 | 284 | 0 | 2 | 286 | +| XML | 12 | 251 | 0 | 1 | 252 | +| Markdown | 5 | 172 | 0 | 32 | 204 | +| Kotlinscript | 3 | 86 | 0 | 19 | 105 | +| Batch | 1 | 39 | 29 | 22 | 90 | +| Properties | 2 | 6 | 2 | 1 | 9 | +| C++ | 1 | 6 | 0 | 2 | 8 | + +## Directories +| path | files | code | comment | blank | total | +| :--- | ---: | ---: | ---: | ---: | ---: | +| . | 498 | 17,106 | 5,533 | 2,324 | 24,963 | +| . (Files) | 9 | 302 | 31 | 69 | 402 | +| .idea | 11 | 238 | 0 | 1 | 239 | +| .idea (Files) | 8 | 212 | 0 | 1 | 213 | +| .idea\\codeStyles | 2 | 20 | 0 | 0 | 20 | +| .idea\\inspectionProfiles | 1 | 6 | 0 | 0 | 6 | +| gradle | 1 | 5 | 0 | 1 | 6 | +| gradle\\wrapper | 1 | 5 | 0 | 1 | 6 | +| mcfpp | 301 | 2,799 | 524 | 346 | 3,669 | +| mcfpp\\dynamic | 22 | 38 | 44 | 14 | 96 | +| mcfpp\\dynamic (Files) | 1 | 8 | 0 | 0 | 8 | +| mcfpp\\dynamic\\src | 21 | 30 | 44 | 14 | 88 | +| mcfpp\\dynamic\\src\\DynamicCommand | 21 | 30 | 44 | 14 | 88 | +| mcfpp\\dynamic\\src\\DynamicCommand (Files) | 1 | 6 | 0 | 1 | 7 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data | 20 | 24 | 44 | 13 | 81 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic | 17 | 16 | 35 | 10 | 61 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic.util | 3 | 8 | 9 | 3 | 20 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic.util\\functions | 3 | 8 | 9 | 3 | 20 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic.util\\functions\\nbt | 3 | 8 | 9 | 3 | 20 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions | 17 | 16 | 35 | 10 | 61 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions (Files) | 1 | 1 | 3 | 0 | 4 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions\\advancement | 4 | 4 | 0 | 0 | 4 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions\\attribute | 3 | 2 | 0 | 1 | 3 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions\\attribute (Files) | 2 | 2 | 0 | 0 | 2 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions\\attribute\\modifier | 1 | 0 | 0 | 1 | 1 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions\\data | 9 | 9 | 32 | 9 | 50 | +| mcfpp\\dynamic\\src\\DynamicCommand\\data\\mcfpp.dynamic\\functions\\data\\modify | 9 | 9 | 32 | 9 | 50 | +| mcfpp\\math | 278 | 2,753 | 480 | 332 | 3,565 | +| mcfpp\\math (Files) | 1 | 8 | 0 | 0 | 8 | +| mcfpp\\math\\src | 277 | 2,745 | 480 | 332 | 3,557 | +| mcfpp\\math\\src\\math | 277 | 2,745 | 480 | 332 | 3,557 | +| mcfpp\\math\\src\\math (Files) | 2 | 12 | 0 | 3 | 15 | +| mcfpp\\math\\src\\math\\data | 275 | 2,733 | 480 | 329 | 3,542 | +| mcfpp\\math\\src\\math\\data\\entitycls | 20 | 240 | 0 | 0 | 240 | +| mcfpp\\math\\src\\math\\data\\entitycls\\tags | 20 | 240 | 0 | 0 | 240 | +| mcfpp\\math\\src\\math\\data\\entitycls\\tags\\entity_types | 20 | 240 | 0 | 0 | 240 | +| mcfpp\\math\\src\\math\\data\\entitycls\\tags\\entity_types\\cbox | 20 | 240 | 0 | 0 | 240 | +| mcfpp\\math\\src\\math\\data\\math | 255 | 2,493 | 480 | 329 | 3,302 | +| mcfpp\\math\\src\\math\\data\\math\\functions | 255 | 2,493 | 480 | 329 | 3,302 | +| mcfpp\\math\\src\\math\\data\\math\\functions (Files) | 12 | 118 | 53 | 18 | 189 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\3vec | 30 | 411 | 83 | 64 | 558 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\3vec (Files) | 23 | 248 | 82 | 37 | 367 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\3vec\\dsp | 3 | 151 | 0 | 27 | 178 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\3vec\\exlen | 4 | 12 | 1 | 0 | 13 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\classify | 4 | 16 | 8 | 0 | 24 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo | 141 | 1,386 | 234 | 149 | 1,769 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo (Files) | 4 | 51 | 13 | 13 | 77 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float | 78 | 896 | 134 | 68 | 1,098 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float (Files) | 27 | 745 | 128 | 56 | 929 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float\\addx_search | 12 | 27 | 0 | 0 | 27 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float\\addy_search | 12 | 27 | 0 | 0 | 27 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float\\addz_search | 12 | 27 | 0 | 0 | 27 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float\\test | 3 | 40 | 6 | 12 | 58 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float\\tovecx | 4 | 10 | 0 | 0 | 10 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float\\tovecy | 4 | 10 | 0 | 0 | 10 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\3vec_float\\tovecz | 4 | 10 | 0 | 0 | 10 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float | 59 | 439 | 87 | 68 | 594 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float (Files) | 27 | 294 | 73 | 45 | 412 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float\\add_search | 15 | 35 | 0 | 0 | 35 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float\\datato | 1 | 1 | 1 | 1 | 3 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float\\test | 6 | 71 | 12 | 20 | 103 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float\\todata | 6 | 28 | 1 | 2 | 31 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float\\todata (Files) | 1 | 8 | 1 | 2 | 11 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float\\todata\\search | 5 | 20 | 0 | 0 | 20 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\hpo\\float\\toscore | 4 | 10 | 0 | 0 | 10 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\marker | 6 | 12 | 6 | 0 | 18 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\obj_entity | 4 | 15 | 8 | 1 | 24 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\set | 32 | 261 | 58 | 65 | 384 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\set (Files) | 25 | 133 | 51 | 27 | 211 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\set\\test | 7 | 128 | 7 | 38 | 173 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\sqrt | 14 | 120 | 14 | 8 | 142 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\test | 12 | 154 | 16 | 24 | 194 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\test (Files) | 2 | 11 | 2 | 3 | 16 | +| mcfpp\\math\\src\\math\\data\\math\\functions\\test\\perf | 10 | 143 | 14 | 21 | 178 | +| mcfpp\\sys | 1 | 8 | 0 | 0 | 8 | +| src | 175 | 13,754 | 4,978 | 1,907 | 20,639 | +| src\\main | 161 | 13,261 | 4,961 | 1,840 | 20,062 | +| src\\main\\cpp | 1 | 6 | 0 | 2 | 8 | +| src\\main\\gen | 1 | 1,300 | 4 | 19 | 1,323 | +| src\\main\\java | 12 | 619 | 50 | 99 | 768 | +| src\\main\\java\\top | 12 | 619 | 50 | 99 | 768 | +| src\\main\\java\\top\\mcfpp | 11 | 615 | 50 | 96 | 761 | +| src\\main\\java\\top\\mcfpp\\annotations | 2 | 18 | 0 | 6 | 24 | +| src\\main\\java\\top\\mcfpp\\jni | 1 | 10 | 0 | 4 | 14 | +| src\\main\\java\\top\\mcfpp\\lang | 8 | 587 | 50 | 86 | 723 | +| src\\main\\java\\top\\mcfppdoc | 1 | 4 | 0 | 3 | 7 | +| src\\main\\java\\top\\mcfppdoc\\antlr | 1 | 4 | 0 | 3 | 7 | +| src\\main\\kotlin | 147 | 11,336 | 4,907 | 1,720 | 17,963 | +| src\\main\\kotlin\\top | 147 | 11,336 | 4,907 | 1,720 | 17,963 | +| src\\main\\kotlin\\top\\mcfpp | 147 | 11,336 | 4,907 | 1,720 | 17,963 | +| src\\main\\kotlin\\top\\mcfpp (Files) | 4 | 300 | 125 | 40 | 465 | +| src\\main\\kotlin\\top\\mcfpp\\annotations | 1 | 24 | 0 | 4 | 28 | +| src\\main\\kotlin\\top\\mcfpp\\antlr | 10 | 2,405 | 737 | 206 | 3,348 | +| src\\main\\kotlin\\top\\mcfpp\\command | 7 | 530 | 148 | 78 | 756 | +| src\\main\\kotlin\\top\\mcfpp\\command (Files) | 5 | 227 | 95 | 51 | 373 | +| src\\main\\kotlin\\top\\mcfpp\\command\\tree | 2 | 303 | 53 | 27 | 383 | +| src\\main\\kotlin\\top\\mcfpp\\commandline | 2 | 132 | 4 | 16 | 152 | +| src\\main\\kotlin\\top\\mcfpp\\compiletime | 5 | 242 | 10 | 37 | 289 | +| src\\main\\kotlin\\top\\mcfpp\\exception | 6 | 22 | 0 | 18 | 40 | +| src\\main\\kotlin\\top\\mcfpp\\io | 4 | 691 | 139 | 39 | 869 | +| src\\main\\kotlin\\top\\mcfpp\\lang | 49 | 4,033 | 2,172 | 673 | 6,878 | +| src\\main\\kotlin\\top\\mcfpp\\lang (Files) | 39 | 3,585 | 2,021 | 577 | 6,183 | +| src\\main\\kotlin\\top\\mcfpp\\lang\\annotation | 1 | 22 | 2 | 6 | 30 | +| src\\main\\kotlin\\top\\mcfpp\\lang\\type | 7 | 372 | 134 | 75 | 581 | +| src\\main\\kotlin\\top\\mcfpp\\lang\\value | 2 | 54 | 15 | 15 | 84 | +| src\\main\\kotlin\\top\\mcfpp\\lib | 2 | 6 | 0 | 6 | 12 | +| src\\main\\kotlin\\top\\mcfpp\\model | 45 | 2,534 | 1,510 | 517 | 4,561 | +| src\\main\\kotlin\\top\\mcfpp\\model (Files) | 11 | 353 | 255 | 91 | 699 | +| src\\main\\kotlin\\top\\mcfpp\\model\\field | 17 | 915 | 596 | 206 | 1,717 | +| src\\main\\kotlin\\top\\mcfpp\\model\\function | 13 | 944 | 602 | 165 | 1,711 | +| src\\main\\kotlin\\top\\mcfpp\\model\\generic | 4 | 322 | 57 | 55 | 434 | +| src\\main\\kotlin\\top\\mcfpp\\util | 12 | 417 | 62 | 86 | 565 | +| src\\test | 14 | 493 | 17 | 67 | 577 | +| src\\test\\java | 2 | 49 | 0 | 13 | 62 | +| src\\test\\java\\top | 2 | 49 | 0 | 13 | 62 | +| src\\test\\java\\top\\mcfpp | 2 | 49 | 0 | 13 | 62 | +| src\\test\\java\\top\\mcfpp\\test | 2 | 49 | 0 | 13 | 62 | +| src\\test\\kotlin | 12 | 444 | 17 | 54 | 515 | +| src\\test\\kotlin\\top | 12 | 444 | 17 | 54 | 515 | +| src\\test\\kotlin\\top\\mcfpp | 12 | 444 | 17 | 54 | 515 | +| src\\test\\kotlin\\top\\mcfpp\\test | 12 | 444 | 17 | 54 | 515 | +| test | 1 | 8 | 0 | 0 | 8 | + +Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md) \ No newline at end of file diff --git a/.VSCodeCounter/2024-05-14_19-40-04/results.txt b/.VSCodeCounter/2024-05-14_19-40-04/results.txt new file mode 100644 index 00000000..e138a723 --- /dev/null +++ b/.VSCodeCounter/2024-05-14_19-40-04/results.txt @@ -0,0 +1,652 @@ +Date : 2024-05-14 19:40:04 +Directory : g:\AST\MCFPP +Total : 498 files, 17106 codes, 5533 comments, 2324 blanks, all 24963 lines + +Languages ++--------------+------------+------------+------------+------------+------------+ +| language | files | code | comment | blank | total | ++--------------+------------+------------+------------+------------+------------+ +| Kotlin | 158 | 11,777 | 4,924 | 1,772 | 18,473 | +| mcfunction | 275 | 2,517 | 524 | 342 | 3,383 | +| Java | 15 | 1,968 | 54 | 131 | 2,153 | +| JSON | 26 | 284 | 0 | 2 | 286 | +| XML | 12 | 251 | 0 | 1 | 252 | +| Markdown | 5 | 172 | 0 | 32 | 204 | +| Kotlinscript | 3 | 86 | 0 | 19 | 105 | +| Batch | 1 | 39 | 29 | 22 | 90 | +| Properties | 2 | 6 | 2 | 1 | 9 | +| C++ | 1 | 6 | 0 | 2 | 8 | ++--------------+------------+------------+------------+------------+------------+ + +Directories ++---------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| path | files | code | comment | blank | total | ++---------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ +| . | 498 | 17,106 | 5,533 | 2,324 | 24,963 | +| . (Files) | 9 | 302 | 31 | 69 | 402 | +| .idea | 11 | 238 | 0 | 1 | 239 | +| .idea (Files) | 8 | 212 | 0 | 1 | 213 | +| .idea\codeStyles | 2 | 20 | 0 | 0 | 20 | +| .idea\inspectionProfiles | 1 | 6 | 0 | 0 | 6 | +| gradle | 1 | 5 | 0 | 1 | 6 | +| gradle\wrapper | 1 | 5 | 0 | 1 | 6 | +| mcfpp | 301 | 2,799 | 524 | 346 | 3,669 | +| mcfpp\dynamic | 22 | 38 | 44 | 14 | 96 | +| mcfpp\dynamic (Files) | 1 | 8 | 0 | 0 | 8 | +| mcfpp\dynamic\src | 21 | 30 | 44 | 14 | 88 | +| mcfpp\dynamic\src\DynamicCommand | 21 | 30 | 44 | 14 | 88 | +| mcfpp\dynamic\src\DynamicCommand (Files) | 1 | 6 | 0 | 1 | 7 | +| mcfpp\dynamic\src\DynamicCommand\data | 20 | 24 | 44 | 13 | 81 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic | 17 | 16 | 35 | 10 | 61 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util | 3 | 8 | 9 | 3 | 20 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions | 3 | 8 | 9 | 3 | 20 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions\nbt | 3 | 8 | 9 | 3 | 20 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions | 17 | 16 | 35 | 10 | 61 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions (Files) | 1 | 1 | 3 | 0 | 4 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement | 4 | 4 | 0 | 0 | 4 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute | 3 | 2 | 0 | 1 | 3 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute (Files) | 2 | 2 | 0 | 0 | 2 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute\modifier | 1 | 0 | 0 | 1 | 1 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data | 9 | 9 | 32 | 9 | 50 | +| mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify | 9 | 9 | 32 | 9 | 50 | +| mcfpp\math | 278 | 2,753 | 480 | 332 | 3,565 | +| mcfpp\math (Files) | 1 | 8 | 0 | 0 | 8 | +| mcfpp\math\src | 277 | 2,745 | 480 | 332 | 3,557 | +| mcfpp\math\src\math | 277 | 2,745 | 480 | 332 | 3,557 | +| mcfpp\math\src\math (Files) | 2 | 12 | 0 | 3 | 15 | +| mcfpp\math\src\math\data | 275 | 2,733 | 480 | 329 | 3,542 | +| mcfpp\math\src\math\data\entitycls | 20 | 240 | 0 | 0 | 240 | +| mcfpp\math\src\math\data\entitycls\tags | 20 | 240 | 0 | 0 | 240 | +| mcfpp\math\src\math\data\entitycls\tags\entity_types | 20 | 240 | 0 | 0 | 240 | +| mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox | 20 | 240 | 0 | 0 | 240 | +| mcfpp\math\src\math\data\math | 255 | 2,493 | 480 | 329 | 3,302 | +| mcfpp\math\src\math\data\math\functions | 255 | 2,493 | 480 | 329 | 3,302 | +| mcfpp\math\src\math\data\math\functions (Files) | 12 | 118 | 53 | 18 | 189 | +| mcfpp\math\src\math\data\math\functions\3vec | 30 | 411 | 83 | 64 | 558 | +| mcfpp\math\src\math\data\math\functions\3vec (Files) | 23 | 248 | 82 | 37 | 367 | +| mcfpp\math\src\math\data\math\functions\3vec\dsp | 3 | 151 | 0 | 27 | 178 | +| mcfpp\math\src\math\data\math\functions\3vec\exlen | 4 | 12 | 1 | 0 | 13 | +| mcfpp\math\src\math\data\math\functions\classify | 4 | 16 | 8 | 0 | 24 | +| mcfpp\math\src\math\data\math\functions\hpo | 141 | 1,386 | 234 | 149 | 1,769 | +| mcfpp\math\src\math\data\math\functions\hpo (Files) | 4 | 51 | 13 | 13 | 77 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float | 78 | 896 | 134 | 68 | 1,098 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float (Files) | 27 | 745 | 128 | 56 | 929 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search | 12 | 27 | 0 | 0 | 27 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search | 12 | 27 | 0 | 0 | 27 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search | 12 | 27 | 0 | 0 | 27 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float\test | 3 | 40 | 6 | 12 | 58 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx | 4 | 10 | 0 | 0 | 10 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy | 4 | 10 | 0 | 0 | 10 | +| mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz | 4 | 10 | 0 | 0 | 10 | +| mcfpp\math\src\math\data\math\functions\hpo\float | 59 | 439 | 87 | 68 | 594 | +| mcfpp\math\src\math\data\math\functions\hpo\float (Files) | 27 | 294 | 73 | 45 | 412 | +| mcfpp\math\src\math\data\math\functions\hpo\float\add_search | 15 | 35 | 0 | 0 | 35 | +| mcfpp\math\src\math\data\math\functions\hpo\float\datato | 1 | 1 | 1 | 1 | 3 | +| mcfpp\math\src\math\data\math\functions\hpo\float\test | 6 | 71 | 12 | 20 | 103 | +| mcfpp\math\src\math\data\math\functions\hpo\float\todata | 6 | 28 | 1 | 2 | 31 | +| mcfpp\math\src\math\data\math\functions\hpo\float\todata (Files) | 1 | 8 | 1 | 2 | 11 | +| mcfpp\math\src\math\data\math\functions\hpo\float\todata\search | 5 | 20 | 0 | 0 | 20 | +| mcfpp\math\src\math\data\math\functions\hpo\float\toscore | 4 | 10 | 0 | 0 | 10 | +| mcfpp\math\src\math\data\math\functions\marker | 6 | 12 | 6 | 0 | 18 | +| mcfpp\math\src\math\data\math\functions\obj_entity | 4 | 15 | 8 | 1 | 24 | +| mcfpp\math\src\math\data\math\functions\set | 32 | 261 | 58 | 65 | 384 | +| mcfpp\math\src\math\data\math\functions\set (Files) | 25 | 133 | 51 | 27 | 211 | +| mcfpp\math\src\math\data\math\functions\set\test | 7 | 128 | 7 | 38 | 173 | +| mcfpp\math\src\math\data\math\functions\sqrt | 14 | 120 | 14 | 8 | 142 | +| mcfpp\math\src\math\data\math\functions\test | 12 | 154 | 16 | 24 | 194 | +| mcfpp\math\src\math\data\math\functions\test (Files) | 2 | 11 | 2 | 3 | 16 | +| mcfpp\math\src\math\data\math\functions\test\perf | 10 | 143 | 14 | 21 | 178 | +| mcfpp\sys | 1 | 8 | 0 | 0 | 8 | +| src | 175 | 13,754 | 4,978 | 1,907 | 20,639 | +| src\main | 161 | 13,261 | 4,961 | 1,840 | 20,062 | +| src\main\cpp | 1 | 6 | 0 | 2 | 8 | +| src\main\gen | 1 | 1,300 | 4 | 19 | 1,323 | +| src\main\java | 12 | 619 | 50 | 99 | 768 | +| src\main\java\top | 12 | 619 | 50 | 99 | 768 | +| src\main\java\top\mcfpp | 11 | 615 | 50 | 96 | 761 | +| src\main\java\top\mcfpp\annotations | 2 | 18 | 0 | 6 | 24 | +| src\main\java\top\mcfpp\jni | 1 | 10 | 0 | 4 | 14 | +| src\main\java\top\mcfpp\lang | 8 | 587 | 50 | 86 | 723 | +| src\main\java\top\mcfppdoc | 1 | 4 | 0 | 3 | 7 | +| src\main\java\top\mcfppdoc\antlr | 1 | 4 | 0 | 3 | 7 | +| src\main\kotlin | 147 | 11,336 | 4,907 | 1,720 | 17,963 | +| src\main\kotlin\top | 147 | 11,336 | 4,907 | 1,720 | 17,963 | +| src\main\kotlin\top\mcfpp | 147 | 11,336 | 4,907 | 1,720 | 17,963 | +| src\main\kotlin\top\mcfpp (Files) | 4 | 300 | 125 | 40 | 465 | +| src\main\kotlin\top\mcfpp\annotations | 1 | 24 | 0 | 4 | 28 | +| src\main\kotlin\top\mcfpp\antlr | 10 | 2,405 | 737 | 206 | 3,348 | +| src\main\kotlin\top\mcfpp\command | 7 | 530 | 148 | 78 | 756 | +| src\main\kotlin\top\mcfpp\command (Files) | 5 | 227 | 95 | 51 | 373 | +| src\main\kotlin\top\mcfpp\command\tree | 2 | 303 | 53 | 27 | 383 | +| src\main\kotlin\top\mcfpp\commandline | 2 | 132 | 4 | 16 | 152 | +| src\main\kotlin\top\mcfpp\compiletime | 5 | 242 | 10 | 37 | 289 | +| src\main\kotlin\top\mcfpp\exception | 6 | 22 | 0 | 18 | 40 | +| src\main\kotlin\top\mcfpp\io | 4 | 691 | 139 | 39 | 869 | +| src\main\kotlin\top\mcfpp\lang | 49 | 4,033 | 2,172 | 673 | 6,878 | +| src\main\kotlin\top\mcfpp\lang (Files) | 39 | 3,585 | 2,021 | 577 | 6,183 | +| src\main\kotlin\top\mcfpp\lang\annotation | 1 | 22 | 2 | 6 | 30 | +| src\main\kotlin\top\mcfpp\lang\type | 7 | 372 | 134 | 75 | 581 | +| src\main\kotlin\top\mcfpp\lang\value | 2 | 54 | 15 | 15 | 84 | +| src\main\kotlin\top\mcfpp\lib | 2 | 6 | 0 | 6 | 12 | +| src\main\kotlin\top\mcfpp\model | 45 | 2,534 | 1,510 | 517 | 4,561 | +| src\main\kotlin\top\mcfpp\model (Files) | 11 | 353 | 255 | 91 | 699 | +| src\main\kotlin\top\mcfpp\model\field | 17 | 915 | 596 | 206 | 1,717 | +| src\main\kotlin\top\mcfpp\model\function | 13 | 944 | 602 | 165 | 1,711 | +| src\main\kotlin\top\mcfpp\model\generic | 4 | 322 | 57 | 55 | 434 | +| src\main\kotlin\top\mcfpp\util | 12 | 417 | 62 | 86 | 565 | +| src\test | 14 | 493 | 17 | 67 | 577 | +| src\test\java | 2 | 49 | 0 | 13 | 62 | +| src\test\java\top | 2 | 49 | 0 | 13 | 62 | +| src\test\java\top\mcfpp | 2 | 49 | 0 | 13 | 62 | +| src\test\java\top\mcfpp\test | 2 | 49 | 0 | 13 | 62 | +| src\test\kotlin | 12 | 444 | 17 | 54 | 515 | +| src\test\kotlin\top | 12 | 444 | 17 | 54 | 515 | +| src\test\kotlin\top\mcfpp | 12 | 444 | 17 | 54 | 515 | +| src\test\kotlin\top\mcfpp\test | 12 | 444 | 17 | 54 | 515 | +| test | 1 | 8 | 0 | 0 | 8 | ++---------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+ + +Files ++---------------------------------------------------------------------------------------------------------------------------------+--------------+------------+------------+------------+------------+ +| filename | language | code | comment | blank | total | ++---------------------------------------------------------------------------------------------------------------------------------+--------------+------------+------------+------------+------------+ +| g:\AST\MCFPP\.idea\codeStyles\Project.xml | XML | 15 | 0 | 0 | 15 | +| g:\AST\MCFPP\.idea\codeStyles\codeStyleConfig.xml | XML | 5 | 0 | 0 | 5 | +| g:\AST\MCFPP\.idea\encodings.xml | XML | 9 | 0 | 0 | 9 | +| g:\AST\MCFPP\.idea\gradle.xml | XML | 17 | 0 | 0 | 17 | +| g:\AST\MCFPP\.idea\inspectionProfiles\Project_Default.xml | XML | 6 | 0 | 0 | 6 | +| g:\AST\MCFPP\.idea\kotlinScripting.xml | XML | 0 | 0 | 1 | 1 | +| g:\AST\MCFPP\.idea\kotlinc.xml | XML | 6 | 0 | 0 | 6 | +| g:\AST\MCFPP\.idea\misc.xml | XML | 43 | 0 | 0 | 43 | +| g:\AST\MCFPP\.idea\statistic.xml | XML | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\.idea\uiDesigner.xml | XML | 124 | 0 | 0 | 124 | +| g:\AST\MCFPP\.idea\vcs.xml | XML | 6 | 0 | 0 | 6 | +| g:\AST\MCFPP\README.md | Markdown | 59 | 0 | 10 | 69 | +| g:\AST\MCFPP\README_CN.md | Markdown | 59 | 0 | 10 | 69 | +| g:\AST\MCFPP\TODO.md | Markdown | 24 | 0 | 5 | 29 | +| g:\AST\MCFPP\TODO_CN.md | Markdown | 24 | 0 | 5 | 29 | +| g:\AST\MCFPP\build.gradle.kts | Kotlinscript | 82 | 0 | 14 | 96 | +| g:\AST\MCFPP\gradle.properties | Properties | 1 | 2 | 0 | 3 | +| g:\AST\MCFPP\gradle\wrapper\gradle-wrapper.properties | Properties | 5 | 0 | 1 | 6 | +| g:\AST\MCFPP\gradlew.bat | Batch | 39 | 29 | 22 | 90 | +| g:\AST\MCFPP\log4j2.xml | XML | 13 | 0 | 0 | 13 | +| g:\AST\MCFPP\mcfpp\dynamic\mcfpp.dynamic.json | JSON | 8 | 0 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions\nbt\append_number_index.mcfunction | mcfunction | 1 | 2 | 1 | 4 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions\nbt\join_path.mcfunction | mcfunction | 6 | 5 | 2 | 13 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic.util\functions\nbt\z_join.mcfunction | mcfunction | 1 | 2 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\everything.mcfunction | mcfunction | 1 | 0 | 0 | 1 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\multi.mcfunction | mcfunction | 1 | 0 | 0 | 1 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\only.mcfunction | mcfunction | 1 | 0 | 0 | 1 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\advancement\only_with_criterion.mcfunction | mcfunction | 1 | 0 | 0 | 1 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute\get.mcfunction | mcfunction | 1 | 0 | 0 | 1 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute\get_scale.mcfunction | mcfunction | 1 | 0 | 0 | 1 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\attribute\modifier\add.mcfunction | mcfunction | 0 | 0 | 1 | 1 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\entity.from.storage.mcfunction | mcfunction | 1 | 3 | 1 | 5 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\entity.from.storage_sp.mcfunction | mcfunction | 1 | 4 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\entity.from.storage_sp2.mcfunction | mcfunction | 1 | 4 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.append.from.entity_sp.mcfunction | mcfunction | 1 | 4 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.entity_sp3.mcfunction | mcfunction | 1 | 4 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.entity_sp5.mcfunction | mcfunction | 1 | 4 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.storage.mcfunction | mcfunction | 1 | 3 | 1 | 5 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.storage_sp4.mcfunction | mcfunction | 1 | 3 | 1 | 5 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\data\modify\storage.from.storage_sp6.mcfunction | mcfunction | 1 | 3 | 1 | 5 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\data\mcfpp.dynamic\functions\function.mcfunction | mcfunction | 1 | 3 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\dynamic\src\DynamicCommand\pack.mcmeta | JSON | 6 | 0 | 1 | 7 | +| g:\AST\MCFPP\mcfpp\math\mcfpp.math.json | JSON | 8 | 0 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\README.md | Markdown | 6 | 0 | 2 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls1.json | JSON | 8 | 0 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls10.json | JSON | 9 | 0 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls11.json | JSON | 12 | 0 | 0 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls12.json | JSON | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls13.json | JSON | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls14.json | JSON | 12 | 0 | 0 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls15.json | JSON | 9 | 0 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls16.json | JSON | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls2.json | JSON | 12 | 0 | 0 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls3.json | JSON | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls4.json | JSON | 9 | 0 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls5.json | JSON | 10 | 0 | 0 | 10 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls6.json | JSON | 15 | 0 | 0 | 15 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls7.json | JSON | 8 | 0 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls8.json | JSON | 8 | 0 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\cls9.json | JSON | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen1.json | JSON | 17 | 0 | 0 | 17 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen2.json | JSON | 25 | 0 | 0 | 25 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen3.json | JSON | 26 | 0 | 0 | 26 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\entitycls\tags\entity_types\cbox\gen4.json | JSON | 25 | 0 | 0 | 25 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_coordto.mcfunction | mcfunction | 4 | 5 | 1 | 10 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_cross.mcfunction | mcfunction | 20 | 1 | 2 | 23 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_dsp-ex.mcfunction | mcfunction | 2 | 4 | 1 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_dsp.mcfunction | mcfunction | 23 | 4 | 4 | 31 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ex-len.mcfunction | mcfunction | 30 | 4 | 5 | 39 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ex-rot.mcfunction | mcfunction | 27 | 10 | 6 | 43 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ex-xyz.mcfunction | mcfunction | 30 | 8 | 4 | 42 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_facingto.mcfunction | mcfunction | 4 | 2 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_fposto.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_get.mcfunction | mcfunction | 6 | 1 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ldsp-ex.mcfunction | mcfunction | 2 | 4 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ldsp.mcfunction | mcfunction | 22 | 4 | 3 | 29 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_polar.mcfunction | mcfunction | 27 | 14 | 7 | 48 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_posto.mcfunction | mcfunction | 6 | 4 | 1 | 11 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_print.mcfunction | mcfunction | 1 | 1 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ssprint.mcfunction | mcfunction | 1 | 1 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_ssrandnew.mcfunction | mcfunction | 8 | 1 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_store.mcfunction | mcfunction | 6 | 1 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_tofacing.mcfunction | mcfunction | 4 | 2 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_tofpos.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_topos.mcfunction | mcfunction | 6 | 4 | 1 | 11 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\_tosto.mcfunction | mcfunction | 7 | 4 | 2 | 13 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\dsp\arrow.mcfunction | mcfunction | 124 | 0 | 24 | 148 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\dsp\loop0.mcfunction | mcfunction | 21 | 0 | 2 | 23 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\dsp\loop1.mcfunction | mcfunction | 6 | 0 | 1 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\3div.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\range0.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\range1.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\exlen\range2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\3vec\init.mcfunction | mcfunction | 6 | 1 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_init.mcfunction | mcfunction | 59 | 14 | 14 | 87 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_posto.mcfunction | mcfunction | 3 | 4 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_random.mcfunction | mcfunction | 8 | 4 | 0 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_refacing.mcfunction | mcfunction | 7 | 4 | 1 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_sincos.mcfunction | mcfunction | 4 | 5 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_sqrt.mcfunction | mcfunction | 16 | 4 | 0 | 20 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_topos.mcfunction | mcfunction | 3 | 4 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_version.mcfunction | mcfunction | 2 | 2 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\_xyz.mcfunction | mcfunction | 4 | 5 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\_append.mcfunction | mcfunction | 5 | 3 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\_ssnew.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\new_group.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\classify\sloop.mcfunction | mcfunction | 7 | 3 | 0 | 10 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3div_resign.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_add.mcfunction | mcfunction | 74 | 19 | 3 | 96 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_cross.mcfunction | mcfunction | 101 | 2 | 4 | 107 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_div.mcfunction | mcfunction | 90 | 19 | 5 | 114 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_dot.mcfunction | mcfunction | 125 | 29 | 6 | 160 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_get.mcfunction | mcfunction | 12 | 1 | 0 | 13 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_length.mcfunction | mcfunction | 18 | 2 | 2 | 22 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_mult.mcfunction | mcfunction | 57 | 13 | 3 | 73 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_rmv.mcfunction | mcfunction | 72 | 19 | 3 | 94 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprint.mcfunction | mcfunction | 22 | 1 | 3 | 26 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprintx.mcfunction | mcfunction | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprinty.mcfunction | mcfunction | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssprintz.mcfunction | mcfunction | 7 | 0 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_ssrandnew.mcfunction | mcfunction | 22 | 2 | 3 | 27 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_store.mcfunction | mcfunction | 12 | 1 | 0 | 13 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_swap.mcfunction | mcfunction | 12 | 1 | 3 | 16 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_tovec.mcfunction | mcfunction | 24 | 4 | 3 | 31 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_unit.mcfunction | mcfunction | 20 | 2 | 3 | 25 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\_vecto.mcfunction | mcfunction | 30 | 13 | 3 | 46 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\add_swapx.mcfunction | mcfunction | 4 | 0 | 2 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\add_swapy.mcfunction | mcfunction | 4 | 0 | 2 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\add_swapz.mcfunction | mcfunction | 4 | 0 | 2 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align1.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align3.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align4.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align5.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align6.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align7.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align_s0.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align_s1.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\align_s2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addx_search\zero.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align1.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align3.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align4.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align5.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align6.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align7.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align_s0.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align_s1.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\align_s2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addy_search\zero.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align1.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align3.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align4.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align5.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align6.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align7.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align_s0.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align_s1.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\align_s2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\addz_search\zero.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\mult_alignx.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\mult_aligny.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\mult_alignz.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\rmv_swapx.mcfunction | mcfunction | 5 | 0 | 2 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\rmv_swapy.mcfunction | mcfunction | 5 | 0 | 2 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\rmv_swapz.mcfunction | mcfunction | 5 | 0 | 2 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\test\length.mcfunction | mcfunction | 6 | 2 | 2 | 10 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\test\main.mcfunction | mcfunction | 13 | 2 | 4 | 19 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\test\new.mcfunction | mcfunction | 21 | 2 | 6 | 29 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\-1_0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\-4_-2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\1_2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecx\3_6.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\-1_0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\-4_-2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\1_2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecy\3_6.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\-1_0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\-4_-2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\1_2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\3vec_float\tovecz\3_6.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\_3div.mcfunction | mcfunction | 15 | 4 | 5 | 24 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\_4div.mcfunction | mcfunction | 16 | 4 | 5 | 25 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_add.mcfunction | mcfunction | 24 | 7 | 3 | 34 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_cmp.mcfunction | mcfunction | 11 | 2 | 1 | 14 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_div.mcfunction | mcfunction | 34 | 7 | 4 | 45 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_equal.mcfunction | mcfunction | 5 | 1 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_get.mcfunction | mcfunction | 4 | 1 | 0 | 5 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_inverse.mcfunction | mcfunction | 31 | 5 | 3 | 39 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_isbigger.mcfunction | mcfunction | 5 | 1 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_isbiggerorequal.mcfunction | mcfunction | 5 | 1 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_issmaller.mcfunction | mcfunction | 5 | 1 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_issmallerorequal.mcfunction | mcfunction | 5 | 1 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_mult.mcfunction | mcfunction | 19 | 6 | 3 | 28 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_notequal.mcfunction | mcfunction | 5 | 1 | 0 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_rmv.mcfunction | mcfunction | 24 | 7 | 3 | 34 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_scoreto.mcfunction | mcfunction | 10 | 5 | 4 | 19 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_sqr.mcfunction | mcfunction | 17 | 6 | 3 | 26 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_sqrt.mcfunction | mcfunction | 14 | 4 | 5 | 23 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_ssprint.mcfunction | mcfunction | 7 | 1 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_ssrandnew.mcfunction | mcfunction | 16 | 2 | 2 | 20 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_store.mcfunction | mcfunction | 4 | 1 | 0 | 5 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_swap.mcfunction | mcfunction | 4 | 1 | 0 | 5 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_toscore.mcfunction | mcfunction | 8 | 1 | 3 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\_zsqr.mcfunction | mcfunction | 17 | 6 | 3 | 26 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\1_2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\3_5.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\6_8.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align1.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align3.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align4.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align5.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align6.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align7.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align_s0.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align_s1.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\align_s2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_search\zero.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\add_swap.mcfunction | mcfunction | 4 | 1 | 3 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\datato\_double.mcfunction | mcfunction | 1 | 1 | 1 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\div_align.mcfunction | mcfunction | 7 | 1 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\mult_align.mcfunction | mcfunction | 2 | 1 | 1 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\rmv_swap.mcfunction | mcfunction | 5 | 1 | 3 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\add.mcfunction | mcfunction | 14 | 2 | 4 | 20 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\div.mcfunction | mcfunction | 14 | 2 | 4 | 20 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\inverse.mcfunction | mcfunction | 8 | 2 | 2 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\mult.mcfunction | mcfunction | 14 | 2 | 4 | 20 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\rmv.mcfunction | mcfunction | 14 | 2 | 4 | 20 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\test\sqrt.mcfunction | mcfunction | 7 | 2 | 2 | 11 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\_double.mcfunction | mcfunction | 8 | 1 | 2 | 11 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\-3_0.mcfunction | mcfunction | 4 | 0 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\-7_-4.mcfunction | mcfunction | 4 | 0 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\-7_8.mcfunction | mcfunction | 4 | 0 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\1_4.mcfunction | mcfunction | 4 | 0 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\todata\search\5_8.mcfunction | mcfunction | 4 | 0 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\-1_0.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\-4_-2.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\1_2.mcfunction | mcfunction | 2 | 0 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\toscore\3_6.mcfunction | mcfunction | 3 | 0 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\float\zmult_align.mcfunction | mcfunction | 2 | 1 | 1 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\hpo\init.mcfunction | mcfunction | 18 | 4 | 3 | 25 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\init_overworld.mcfunction | mcfunction | 5 | 6 | 1 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_chest.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_math.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_origin.mcfunction | mcfunction | 1 | 1 | 0 | 2 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_return.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_sign.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\marker\_uuid.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\_new.mcfunction | mcfunction | 1 | 1 | 1 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\_reid.mcfunction | mcfunction | 8 | 5 | 0 | 13 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\get_newint.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\obj_entity\set.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_append.mcfunction | mcfunction | 7 | 2 | 3 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_cross.mcfunction | mcfunction | 11 | 4 | 3 | 18 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_diff.mcfunction | mcfunction | 11 | 5 | 3 | 19 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_ex-tags.mcfunction | mcfunction | 4 | 2 | 1 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_get.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_merge.mcfunction | mcfunction | 7 | 4 | 3 | 14 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_new.mcfunction | mcfunction | 3 | 3 | 1 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_of.mcfunction | mcfunction | 6 | 5 | 3 | 14 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_print.mcfunction | mcfunction | 4 | 1 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_ssnew.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_ssprint.mcfunction | mcfunction | 4 | 1 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_store.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_subset.mcfunction | mcfunction | 8 | 4 | 4 | 16 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\_swap.mcfunction | mcfunction | 7 | 1 | 2 | 10 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\append_success.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\cross_sloop.mcfunction | mcfunction | 8 | 2 | 0 | 10 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\cross_success.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\diff_sloop.mcfunction | mcfunction | 7 | 2 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\diff_success.mcfunction | mcfunction | 4 | 1 | 0 | 5 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\init.mcfunction | mcfunction | 4 | 1 | 2 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\merge_sloop.mcfunction | mcfunction | 7 | 2 | 0 | 9 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\merge_success.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\set.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\subset_sloop.mcfunction | mcfunction | 6 | 2 | 0 | 8 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\tags_sloop.mcfunction | mcfunction | 5 | 2 | 0 | 7 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\base.mcfunction | mcfunction | 32 | 1 | 7 | 40 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\cross.mcfunction | mcfunction | 18 | 1 | 5 | 24 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\diff.mcfunction | mcfunction | 19 | 1 | 6 | 26 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\ex-tags.mcfunction | mcfunction | 10 | 1 | 4 | 15 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\merge.mcfunction | mcfunction | 19 | 1 | 6 | 26 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\of.mcfunction | mcfunction | 9 | 1 | 4 | 14 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\set\test\subset.mcfunction | mcfunction | 21 | 1 | 6 | 28 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\_3self.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\_3sqrt.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\_self.mcfunction | mcfunction | 16 | 1 | 0 | 17 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range0.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range1.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range2.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range3.mcfunction | mcfunction | 21 | 1 | 3 | 25 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range4.mcfunction | mcfunction | 18 | 1 | 1 | 20 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range5.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range6.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range7.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range8.mcfunction | mcfunction | 21 | 1 | 2 | 24 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\range9.mcfunction | mcfunction | 19 | 1 | 2 | 22 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\sqrt\rmv.mcfunction | mcfunction | 2 | 1 | 0 | 3 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test.mcfunction | mcfunction | 3 | 1 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\_perf.mcfunction | mcfunction | 7 | 1 | 2 | 10 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_loop.mcfunction | mcfunction | 3 | 2 | 0 | 5 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_print.mcfunction | mcfunction | 31 | 1 | 4 | 36 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_ssnew.mcfunction | mcfunction | 28 | 1 | 5 | 34 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_ssprint.mcfunction | mcfunction | 26 | 1 | 4 | 31 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_start.mcfunction | mcfunction | 9 | 1 | 2 | 12 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_std.mcfunction | mcfunction | 28 | 1 | 4 | 33 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\_tick.mcfunction | mcfunction | 10 | 1 | 2 | 13 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\std_loop0.mcfunction | mcfunction | 2 | 2 | 0 | 4 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\std_loop1.mcfunction | mcfunction | 3 | 2 | 0 | 5 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\perf\std_loop2.mcfunction | mcfunction | 3 | 2 | 0 | 5 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\test\run.mcfunction | mcfunction | 4 | 1 | 1 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\data\math\functions\tick.mcfunction | mcfunction | 4 | 0 | 2 | 6 | +| g:\AST\MCFPP\mcfpp\math\src\math\pack.mcmeta | JSON | 6 | 0 | 1 | 7 | +| g:\AST\MCFPP\mcfpp\sys\mcfpp.sys.json | JSON | 8 | 0 | 0 | 8 | +| g:\AST\MCFPP\settings.gradle.kts | Kotlinscript | 1 | 0 | 3 | 4 | +| g:\AST\MCFPP\src\main\cpp\test.cpp | C++ | 6 | 0 | 2 | 8 | +| g:\AST\MCFPP\src\main\gen\mcfppLexer.java | Java | 1,300 | 4 | 19 | 1,323 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\annotations\InsertCommand.java | Java | 9 | 0 | 3 | 12 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\annotations\MCFPPNative.java | Java | 9 | 0 | 3 | 12 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\jni\Test.java | Java | 10 | 0 | 4 | 14 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\MCAnyData.java | Java | 27 | 2 | 7 | 36 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\MCIntData.java | Java | 25 | 1 | 8 | 34 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTDictionaryData.java | Java | 26 | 0 | 8 | 34 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTListConcreteData.java | Java | 181 | 15 | 15 | 211 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTListData.java | Java | 210 | 11 | 14 | 235 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\NBTMapData.java | Java | 44 | 0 | 14 | 58 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\Range.java | Java | 13 | 11 | 8 | 32 | +| g:\AST\MCFPP\src\main\java\top\mcfpp\lang\System.java | Java | 61 | 10 | 12 | 83 | +| g:\AST\MCFPP\src\main\java\top\mcfppdoc\antlr\McfppDocVisitor.java | Java | 4 | 0 | 3 | 7 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\CompileSettings.kt | Kotlin | 5 | 6 | 2 | 13 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\MCFPP.kt | Kotlin | 53 | 3 | 3 | 59 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\Project.kt | Kotlin | 241 | 116 | 33 | 390 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\annotations\MCFPNativeProcessor.kt | Kotlin | 24 | 0 | 4 | 28 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppErrorListener.kt | Kotlin | 4 | 0 | 3 | 7 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppExprVisitor.kt | Kotlin | 505 | 120 | 28 | 653 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppFieldVisitor.kt | Kotlin | 641 | 162 | 47 | 850 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppFuncManager.kt | Kotlin | 64 | 35 | 7 | 106 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppGenericClassVisitor.kt | Kotlin | 58 | 9 | 4 | 71 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppImVisitor.kt | Kotlin | 763 | 235 | 94 | 1,092 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppInlineFunctionVisitor.kt | Kotlin | 3 | 0 | 2 | 5 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppLeftExprVisitor.kt | Kotlin | 184 | 38 | 6 | 228 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\McfppTypeVisitor.kt | Kotlin | 180 | 65 | 13 | 258 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\antlr\NativeClassVisitor.kt | Kotlin | 3 | 73 | 2 | 78 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\Command.kt | Kotlin | 104 | 53 | 23 | 180 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\CommandList.kt | Kotlin | 30 | 0 | 7 | 37 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\Commands.kt | Kotlin | 75 | 37 | 12 | 124 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\Comment.kt | Kotlin | 17 | 0 | 7 | 24 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\package-info.kt | Kotlin | 1 | 5 | 2 | 8 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\tree\CommandTreeModel.kt | Kotlin | 12 | 24 | 4 | 40 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\command\tree\DownloadHelper.kt | Kotlin | 291 | 29 | 23 | 343 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\commandline\LineCompiler.kt | Kotlin | 60 | 1 | 8 | 69 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\commandline\Main.kt | Kotlin | 72 | 3 | 8 | 83 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\CompileTimeFunction.kt | Kotlin | 31 | 5 | 5 | 41 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\CompileTimeFunctionField.kt | Kotlin | 21 | 5 | 3 | 29 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\JavaScriptInterpreter.kt | Kotlin | 11 | 0 | 3 | 14 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\MCControl.kt | Kotlin | 6 | 0 | 2 | 8 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\compiletime\McfppCompileTimeVisitor.kt | Kotlin | 173 | 0 | 24 | 197 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\CommandException.kt | Kotlin | 3 | 0 | 1 | 4 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\IllegalFormatException.kt | Kotlin | 3 | 0 | 3 | 6 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\OperationNotImplementException.kt | Kotlin | 5 | 0 | 5 | 10 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\UndefinedException.kt | Kotlin | 3 | 0 | 1 | 4 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\VariableConverseException.kt | Kotlin | 5 | 0 | 5 | 10 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\exception\VariableNotResolvedException.kt | Kotlin | 3 | 0 | 3 | 6 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\DatapackCreator.kt | Kotlin | 178 | 54 | 8 | 240 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\LibReader.kt | Kotlin | 241 | 41 | 8 | 290 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\LibWriter.kt | Kotlin | 169 | 26 | 9 | 204 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\io\MCFPPFile.kt | Kotlin | 103 | 18 | 14 | 135 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\CanSelectMember.kt | Kotlin | 9 | 19 | 5 | 33 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ClassBase.kt | Kotlin | 16 | 19 | 4 | 39 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ClassObject.kt | Kotlin | 65 | 46 | 15 | 126 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ClassPointer.kt | Kotlin | 130 | 70 | 21 | 221 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\CompoundDataType.kt | Kotlin | 49 | 25 | 10 | 84 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Entity.kt | Kotlin | 13 | 127 | 2 | 142 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\INativeClass.kt | Kotlin | 9 | 9 | 2 | 20 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Indexable.kt | Kotlin | 4 | 0 | 3 | 7 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\IntTemplateBase.kt | Kotlin | 7 | 3 | 5 | 15 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\IntTemplatePointer.kt | Kotlin | 45 | 27 | 15 | 87 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\IntTemplateType.kt | Kotlin | 7 | 0 | 4 | 11 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\JavaVar.kt | Kotlin | 136 | 69 | 23 | 228 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\JsonString.kt | Kotlin | 10 | 87 | 2 | 99 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\JsonText.kt | Kotlin | 35 | 15 | 12 | 62 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCAny.kt | Kotlin | 128 | 119 | 24 | 271 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCBool.kt | Kotlin | 251 | 53 | 37 | 341 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCFPPTypeVar.kt | Kotlin | 56 | 0 | 15 | 71 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCFloat.kt | Kotlin | 576 | 210 | 57 | 843 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCInt.kt | Kotlin | 565 | 96 | 51 | 712 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCNumber.kt | Kotlin | 43 | 86 | 22 | 151 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\MCString.kt | Kotlin | 118 | 59 | 20 | 197 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTAny.kt | Kotlin | 1 | 147 | 1 | 149 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTBasedData.kt | Kotlin | 518 | 116 | 46 | 680 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTDictionary.kt | Kotlin | 146 | 56 | 24 | 226 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTList.kt | Kotlin | 151 | 53 | 26 | 230 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTMap.kt | Kotlin | 67 | 40 | 12 | 119 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTTemplateBase.kt | Kotlin | 3 | 0 | 1 | 4 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTTemplatePointer.kt | Kotlin | 3 | 0 | 1 | 4 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\NBTTemplateType.kt | Kotlin | 3 | 0 | 1 | 4 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\OnScoreboard.kt | Kotlin | 4 | 3 | 1 | 8 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Range.kt | Kotlin | 1 | 3 | 1 | 5 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\ReturnedMCBool.kt | Kotlin | 28 | 22 | 7 | 57 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\SbObject.kt | Kotlin | 43 | 20 | 13 | 76 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Selector.kt | Kotlin | 17 | 158 | 3 | 178 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Storage.kt | Kotlin | 26 | 5 | 8 | 39 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\UnknownVar.kt | Kotlin | 25 | 27 | 13 | 65 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\UnresolvedVar.kt | Kotlin | 51 | 56 | 16 | 123 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Var.kt | Kotlin | 179 | 149 | 43 | 371 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\Void.kt | Kotlin | 47 | 27 | 11 | 85 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\annotation\Inject.kt | Kotlin | 22 | 2 | 6 | 30 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPBaseType.kt | Kotlin | 61 | 18 | 7 | 86 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPClassType.kt | Kotlin | 66 | 22 | 11 | 99 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPGenericClassType.kt | Kotlin | 9 | 0 | 4 | 13 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPGenericType.kt | Kotlin | 13 | 17 | 4 | 34 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPNBTType.kt | Kotlin | 46 | 17 | 16 | 79 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPTemplateType.kt | Kotlin | 22 | 4 | 7 | 33 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\type\MCFPPType.kt | Kotlin | 155 | 56 | 26 | 237 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\value\MCFPPTypeValue.kt | Kotlin | 46 | 8 | 12 | 66 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lang\value\MCFPPValue.kt | Kotlin | 8 | 7 | 3 | 18 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lib\ConstantPool.kt | Kotlin | 4 | 0 | 4 | 8 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\lib\MacroFunctionGenerator.kt | Kotlin | 2 | 0 | 2 | 4 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Annotation.kt | Kotlin | 41 | 25 | 12 | 78 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Class.kt | Kotlin | 104 | 87 | 26 | 217 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\CompoundData.kt | Kotlin | 104 | 63 | 19 | 186 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\FieldContainer.kt | Kotlin | 4 | 7 | 1 | 12 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Interface.kt | Kotlin | 14 | 12 | 5 | 31 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Member.kt | Kotlin | 10 | 21 | 6 | 37 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Native.kt | Kotlin | 2 | 0 | 1 | 3 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\NativeClass.kt | Kotlin | 13 | 3 | 4 | 20 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\Template.kt | Kotlin | 57 | 34 | 13 | 104 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\UnknownClass.kt | Kotlin | 3 | 0 | 2 | 5 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\CompoundDataField.kt | Kotlin | 122 | 46 | 28 | 196 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\FileField.kt | Kotlin | 2 | 0 | 1 | 3 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\FunctionField.kt | Kotlin | 106 | 57 | 25 | 188 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\GlobalField.kt | Kotlin | 263 | 71 | 21 | 355 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IField.kt | Kotlin | 3 | 20 | 3 | 26 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithClass.kt | Kotlin | 10 | 36 | 8 | 54 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithFunction.kt | Kotlin | 9 | 17 | 6 | 32 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithInterface.kt | Kotlin | 10 | 32 | 8 | 50 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithTemplate.kt | Kotlin | 12 | 32 | 7 | 51 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithType.kt | Kotlin | 10 | 27 | 8 | 45 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\IFieldWithVar.kt | Kotlin | 10 | 27 | 8 | 45 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\InternalFunctionField.kt | Kotlin | 51 | 20 | 10 | 81 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\NamespaceField.kt | Kotlin | 185 | 160 | 42 | 387 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\NoStackFunctionField.kt | Kotlin | 11 | 5 | 4 | 20 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\SimpleFieldWithFunction.kt | Kotlin | 39 | 13 | 9 | 61 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\SimpleFieldWithType.kt | Kotlin | 35 | 3 | 9 | 47 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\field\SimpleFieldWithVar.kt | Kotlin | 37 | 30 | 9 | 76 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\Constructor.kt | Kotlin | 108 | 26 | 9 | 143 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\ExtensionFunction.kt | Kotlin | 40 | 14 | 7 | 61 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\Function.kt | Kotlin | 480 | 375 | 72 | 927 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\FunctionParam.kt | Kotlin | 74 | 32 | 15 | 121 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\FunctionTag.kt | Kotlin | 47 | 12 | 8 | 67 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\InlineFunction.kt | Kotlin | 38 | 50 | 11 | 99 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\InternalFunction.kt | Kotlin | 24 | 28 | 6 | 58 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\JavaFunction.kt | Kotlin | 17 | 2 | 6 | 25 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\NativeConstructor.kt | Kotlin | 11 | 0 | 2 | 13 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\NativeFunction.kt | Kotlin | 62 | 57 | 18 | 137 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\NoStackFunction.kt | Kotlin | 8 | 0 | 4 | 12 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\TemplateConstructor.kt | Kotlin | 22 | 1 | 4 | 27 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\function\UnknownFunction.kt | Kotlin | 13 | 5 | 3 | 21 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\Generic.kt | Kotlin | 16 | 0 | 10 | 26 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\GenericClass.kt | Kotlin | 47 | 13 | 17 | 77 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\GenericExtensionFunction.kt | Kotlin | 118 | 15 | 13 | 146 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\generic\GenericFunction.kt | Kotlin | 141 | 29 | 15 | 185 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\model\package-info.kt | Kotlin | 1 | 3 | 2 | 6 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\package-info.kt | Kotlin | 1 | 0 | 2 | 3 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\AntlrUtil.kt | Kotlin | 18 | 0 | 4 | 22 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\AnyTag.kt | Kotlin | 11 | 5 | 5 | 21 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\LazyWrapper.kt | Kotlin | 31 | 11 | 9 | 51 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\LogProcesser.kt | Kotlin | 36 | 0 | 11 | 47 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\MCUUID.kt | Kotlin | 20 | 0 | 7 | 27 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\MacroHelper.kt | Kotlin | 12 | 5 | 4 | 21 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\NBTUtil.kt | Kotlin | 105 | 5 | 16 | 126 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\ResourceLocation.kt | Kotlin | 22 | 17 | 5 | 44 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\StringHelper.kt | Kotlin | 34 | 5 | 4 | 43 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\Utils.kt | Kotlin | 60 | 10 | 16 | 86 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\UwU.kt | Kotlin | 66 | 4 | 4 | 74 | +| g:\AST\MCFPP\src\main\kotlin\top\mcfpp\util\ValueWrapper.kt | Kotlin | 2 | 0 | 1 | 3 | +| g:\AST\MCFPP\src\test\java\top\mcfpp\test\GenericsTest.java | Java | 41 | 0 | 10 | 51 | +| g:\AST\MCFPP\src\test\java\top\mcfpp\test\NativeTest.java | Java | 8 | 0 | 3 | 11 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\CommandTreeDeserializeTest.kt | Kotlin | 92 | 0 | 5 | 97 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\CompileTest.kt | Kotlin | 113 | 0 | 16 | 129 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\CompileTimeTest.kt | Kotlin | 36 | 1 | 3 | 40 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\FloatTest.kt | Kotlin | 19 | 0 | 3 | 22 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\JavaScriptInterpreterTest.kt | Kotlin | 9 | 0 | 4 | 13 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\MCFPPStringTest.kt | Kotlin | 98 | 16 | 3 | 117 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NBTAnyDataTypeTest.kt | Kotlin | 18 | 0 | 4 | 22 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NBTTest.kts | Kotlinscript | 3 | 0 | 2 | 5 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NashornTest.kt | Kotlin | 12 | 0 | 3 | 15 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\NativeTest1.kt | Kotlin | 17 | 0 | 3 | 20 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\StringCompileTest.kt | Kotlin | 13 | 0 | 4 | 17 | +| g:\AST\MCFPP\src\test\kotlin\top\mcfpp\test\StringTest.kt | Kotlin | 14 | 0 | 4 | 18 | +| g:\AST\MCFPP\test\Test.json | JSON | 8 | 0 | 0 | 8 | +| Total | | 17,106 | 5,533 | 2,324 | 24,963 | ++---------------------------------------------------------------------------------------------------------------------------------+--------------+------------+------------+------------+------------+ \ No newline at end of file diff --git a/.gitignore b/.gitignore index b63da455..1b1af921 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,10 @@ build/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ +/downloader/ ### IntelliJ IDEA ### -.idea/modules.xml -.idea/jarRepositories.xml -.idea/compiler.xml -.idea/libraries/ +.idea *.iws *.iml *.ipr @@ -39,4 +37,4 @@ bin/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 359bb530..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# 默认忽略的文件 -/shelf/ -/workspace.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 2e9a7d73..00000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 6e6eec11..00000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 611e7c8a..00000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index df543e3a..00000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 2b8a50fc..00000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index f5e42907..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.mclib b/.mclib new file mode 100644 index 00000000..6f7e9f53 --- /dev/null +++ b/.mclib @@ -0,0 +1,329 @@ +{ + "namespaces":[ + { + "id":"default", + "functions":[ + { + "id":"main", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ], + "classes":[ + { + "id":"Test", + "parents":[ + "mcfpp:any" + ], + "generic":[ + { + "id":"i", + "type":"int" + } + ], + "context":"ACED00057372002B746F702E6D636670702E7574696C2E53657269616C697A61626C65436C617373426F6479436F6E74657874054A027FE4B581400200007870", + "field":{ + "vars":[ + + ], + "functions":[ + { + "id":"_class_preinit_Test", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "staticField":{ + "vars":[ + + ], + "functions":[ + { + "id":"_class_prestaticinit_Test", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "constructors":[ + + ] + }, + { + "id":"Test", + "parents":[ + "mcfpp:any" + ], + "generic":[ + { + "id":"i", + "type":"int" + }, + { + "id":"j", + "type":"int" + } + ], + "context":"ACED00057372002B746F702E6D636670702E7574696C2E53657269616C697A61626C65436C617373426F6479436F6E74657874054A027FE4B581400200007870", + "field":{ + "vars":[ + + ], + "functions":[ + { + "id":"_class_preinit_Test", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "staticField":{ + "vars":[ + + ], + "functions":[ + { + "id":"_class_prestaticinit_Test", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "constructors":[ + + ] + }, + { + "id":"Test_int_int_0", + "parents":[ + "mcfpp:any" + ], + "field":{ + "vars":[ + { + "id":"e702de50-7f50-49f6-82f9-282fde1cbff8", + "type":"int" + }, + { + "id":"a09cff90-4fad-425a-8fd6-0b7541219411", + "type":"int" + } + ], + "functions":[ + { + "id":"_class_preinit_Test_int_int_0", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"print", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"_init_test_int_int_0_0_lead", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "staticField":{ + "vars":[ + + ], + "functions":[ + { + "id":"_class_prestaticinit_Test_int_int_0", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "constructors":[ + { + "normalParams":[ + + ] + } + ] + }, + { + "id":"Test_int_0", + "parents":[ + "mcfpp:any" + ], + "field":{ + "vars":[ + { + "id":"082e4970-deaa-4823-bb56-82e9482be6c1", + "type":"int" + } + ], + "functions":[ + { + "id":"_class_preinit_Test_int_0", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"print", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"_init_test_int_0_0_lead", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "staticField":{ + "vars":[ + + ], + "functions":[ + { + "id":"_class_prestaticinit_Test_int_0", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ] + }, + "constructors":[ + { + "normalParams":[ + + ] + } + ] + } + ], + "template":[ + + ] + }, + { + "id":"mcfpp", + "functions":[ + { + "id":"load", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"tick", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"init", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ], + "classes":[ + + ], + "template":[ + + ] + } + ] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 00000000..243c8556 --- /dev/null +++ b/README.md @@ -0,0 +1,91 @@ +![](https://user-images.githubusercontent.com/90548686/236462051-b901f99c-bdef-435c-8ca2-0dda37b25285.png) +[简体中文](./README_CN.md) +------------ +# Introduce +MCFPP is a brand new objected-oriented language that can be compiled into Minecraft Datapack. It aims to write datapacks in a syntax similar to C language, and introduces commonly used concepts in programming, thereby making the writing of datapacks more efficient. + +**This project is still in the early stage of development and cannot be used for actual use. Some functions have not been implemented, and features may change in future versions. The library is also not complete.** + +# QuickStart +[MCFPP API](https://www.mcfpp.top) +# Relative Projects +## [MCSharp](https://github.com/Voziv/MCSharp) + +MCSharp is a CSharp library. Using MCSharp, developers can develop datapacks using CSharp. However, this project has been stopped due to technical issues. MCFPP inherits part of the ideas of MCSharp. + +## [justMCF](https://github.com/XiLaiTL/JustMCF) + +JustMCF is a project to simplify mcfunction projects. Using JustMCF, you can not only use the original commands, but also use the simplified commands designed by the project, which can make your commands more concise and efficient. + +# [Update Plan](./TODO.md) +* [ ] Code optimization +* [ ] Garbage collection mechanism +* [ ] More variable features (const, dynamic, import) +* [ ] Interface +* [ ] Inheritance and polymorphism +* [ ] Struct +* [ ] Operator overload +* [ ] Inline Function +* [ ] Sandbox +* * [ ] Syntactic sugar form of native +* [ ] Versioned compilation +* [ ] Basic library +* [ ] Enum + + +# Features +## Basic logical statements +``` +func example(){ + int i = @s.nbt.pos[0]; + if(i > 0){ + @s.say("Hello Minecraft!"); + } +} +``` +## Object-oriented programming +``` +class Example{ + int i; + public Example(int i){ + this.i = i; + } + public func print(){ + print(this.i); + } +} +``` +## Libraries +``` +import mcfpp.math; + +void example{ + float i = 1.5; + float out; + out = pow(i, 2); + print(out); +} +``` +## Generics +``` +class Example{ + T i; + public Example(T i){ + this.i = i; + } + public func print(){ + print(this.i); + } +} + +func test(T i){ + print(i); +} +``` +## Original Minecraft Command +``` +func test(){ + /execute as @a run say Hello Minecraft! +} +``` +To see more features, please refer to the [MCFPP API](https://www.mcfpp.top) \ No newline at end of file diff --git a/README_CN.md b/README_CN.md new file mode 100644 index 00000000..ed2085a2 --- /dev/null +++ b/README_CN.md @@ -0,0 +1,91 @@ +![](https://user-images.githubusercontent.com/90548686/236462051-b901f99c-bdef-435c-8ca2-0dda37b25285.png) +[English](./README.md) +------------ +# 介绍 +MCFPP是一个能被编译为Minecraft数据包的全新的面向对象的语言。它旨在以类似C系语言的语法,进行数据包的编写,并引入编程中常用的概念,从而使数据包的编写更加的便利。 + +**这个项目仍然处于早期的开发阶段中,尚不能用于实际运用。部分功能尚未实现,特性可能会在未来的版本中发生变化。库函数尚不齐全。** + +# 快速开始 +[MCFPP API](https://www.mcfpp.top) + +# [更新计划](./TODO_CN.md) +* [ ] 代码优化 +* [ ] 垃圾回收机制 +* [ ] 更多的变量特性 +* [ ] 接口 +* [ ] 类的继承和多态 +* [ ] 结构体 +* [ ] 运算符重载 +* [ ] 内联函数(Inline Function) +* [ ] 沙箱 + * [ ] native的语法糖形式 +* [ ] 分版本编译 +* [ ] 基本库 +* [ ] 枚举 + +# 相关工程 +## [MCSharp](https://github.com/Voziv/MCSharp) + +MCSharp是一个CSharp库。利用MCSharp,开发者可以使用CSharp进行数据包的开发。但是,此项目因为技术问题已经被停止。MCFPP继承了部分MCSharp的思想。 + +## [justMCF](https://github.com/XiLaiTL/JustMCF) + +JustMCF是一个简化mcfunction工程的项目。使用JustMCF,你不但可以使用原版的命令,还可以使用项目设计的简化命令,可以使你的命令更加简洁高效。 + +# 特性 +## 基本的逻辑语句 +``` +void example(){ + int i = @s.pos[0]; + if(i > 0){ + @s.say("Hello Minecraft!"); + } +} +``` +## 面向对象的编程 +``` +class Example{ + int i; + public Example(int i){ + this.i = i; + } + public void print(){ + sys.print(this.i); + } +} +``` +## 库的调用 +``` +import mcfpp.math; + +void example{ + float i = 1.5; + float out; + out = pow(i, 2); + print(out); +} +``` +## 泛型 +``` +class Example{ + T i; + public Example(T i){ + this.i = i; + } + public func print(){ + print(this.i); + } +} + +func test(T i){ + print(i); +} +``` +## 直接使用原版Minecraft命令 +``` +func test(){ + /execute as @a run say Hello Minecraft! +} +``` +To see more features, please refer to the [MCFPP API](https://www.mcfpp.top) \ No newline at end of file diff --git a/TODO.md b/TODO.md new file mode 100644 index 00000000..52dedd52 --- /dev/null +++ b/TODO.md @@ -0,0 +1,28 @@ +# Plan List + +## In Progress +These tasks are currently underway: +* [ ] Code optimization +* [ ] Garbage collection mechanism +* [ ] Interfaces +* [ ] Class inheritance +* [ ] Templates +* [ ] Strings +* [ ] Entities +* [ ] Automatic namespace allocation according to folders + +## Planned +The following items are planned for the near future: +* Operator overloading +* Compile-time functions +* Versioned compilation +* Basic library +* Enumerations +* Non-interrupting exception compilation + +## Known Issues +* [ ] Incorrect modification of local function values during recursive calls + +## Optimization +* [ ] Set constants early in load +* [ ] Optimize if statement logic and readability diff --git a/TODO_CN.md b/TODO_CN.md new file mode 100644 index 00000000..ec81f357 --- /dev/null +++ b/TODO_CN.md @@ -0,0 +1,28 @@ +# 计划单 + +## 进行中 +这些任务是正在进行的 +* [ ] 代码优化 +* [ ] 垃圾回收机制 +* [ ] 接口 +* [ ] 类的继承 +* [ ] 模板 +* [ ] 字符串 +* [ ] 实体 +* [ ] 命名空间按照文件夹自动分配 + +## 计划中 +计划中的内容将会在不久的将来实现 +* 运算符重载 +* 编译时函数 +* 分版本编译 +* 基本库 +* 枚举 +* 异常非中断编译 + +## 已知问题 +* [ ] 递归调用的时候,错误地修改了本层函数的值 + +## 优化 +* [ ] 常数在load中提前设置 +* [ ] if语句逻辑优化和可读性优化 diff --git a/build.gradle.kts b/build.gradle.kts index a68b5509..fb468b5b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,21 +1,26 @@ +import org.gradle.kotlin.dsl.cpp +import java.nio.file.Files +import java.util.Optional + plugins { kotlin("jvm") version "1.8.0" groovy application antlr + id("org.jetbrains.dokka") version "1.8.10" + java + cpp } -group = "top.alumopper" +group = "top.mcfpp" version = "1.0-SNAPSHOT" repositories { mavenCentral() - maven { - setUrl("https://jitpack.io") - } - maven { - setUrl("https://maven.aliyun.com/nexus/content/groups/public/") - } + maven("https://jitpack.io") + maven("https://maven.aliyun.com/nexus/content/groups/public/") + maven("https://jitpack.io/") + maven("https://libraries.minecraft.net") } dependencies { @@ -24,8 +29,18 @@ dependencies { implementation("com.alibaba.fastjson2:fastjson2:2.0.28") implementation("org.apache.logging.log4j:log4j-api:2.20.0") implementation("org.apache.logging.log4j:log4j-core:2.20.0") + implementation("org.openjdk.nashorn:nashorn-core:15.4") + implementation("com.github.Querz:NBT:6.1") + implementation("com.mojang:brigadier:1.0.18") + implementation("org.commonmark:commonmark:0.20.0") + implementation("org.commonmark:commonmark-ext-heading-anchor:0.21.0") + implementation("org.commonmark:commonmark-ext-gfm-tables:0.20.0") + implementation("org.commonmark:commonmark-ext-task-list-items:0.21.0") + implementation("fr.brouillard.oss:commonmark-ext-notifications:1.1.0") antlr("org.antlr:antlr4:4.12.0") - + implementation(kotlin("reflect")) + testImplementation(kotlin("script-runtime")) + implementation("com.google.guava:guava:33.2.0-jre") } tasks.test { @@ -33,28 +48,131 @@ tasks.test { } tasks.generateGrammarSource { - arguments = arguments + listOf("-visitor", "-long-messages") -// outputDirectory = File("src/gen") + mkdir("build") + arguments = arguments + + listOf("-visitor", "-long-messages") + + listOf( "-package", "top.mcfpp.antlr") + outputDirectory = File("build/generated-src/antlr/main/top/mcfpp/antlr") } tasks.jar{ manifest{ - attributes("Main-Class" to "MCFPPKt") + attributes("Main-Class" to "top.mcfpp.MCFPPKt") } duplicatesStrategy = DuplicatesStrategy.INCLUDE from(configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }) + + from("build/dll"){ + into("native") + include("**/*.dll") + } +} + +val jniSourceDir = file("src/main/java/top/mcfpp/jni") +val cppSourceDir = file("src/main/cpp") + +tasks.register("generateJni") { + group = "build" + destinationDirectory.set(file("$buildDir/generated/jni")) + source = fileTree(jniSourceDir) + classpath = files() + options.compilerArgs = listOf("-h", "$buildDir/generated/jni") +} + +tasks.register("compileCpp") { + group = "build" + workingDir(cppSourceDir) + + val osOptional = OperatingSystem.current() + if (osOptional.isEmpty) + throw RuntimeException("Failed to compile JNI source due to unsupported operating system.") + val os = osOptional.get() + + fun dirName(): String { + return when (os) { + OperatingSystem.WINDOWS -> "win32" + OperatingSystem.MACOS -> "darwin" + OperatingSystem.LINUX -> "linux" + } + } + fun extName(): String { + return when (os) { + OperatingSystem.WINDOWS -> ".dll" + OperatingSystem.MACOS -> ".dylib" + OperatingSystem.LINUX -> ".so" + } + } + + val outputDirStr = "$buildDir/dll" + val outputDir = File(outputDirStr) + if (!outputDir.exists()) { + outputDir.mkdir() + } + + val cmdArgs = ArrayList() + cmdArgs.addAll(listOf( + "g++", + "-fPIC", + "-I", + "${System.getProperty("java.home")}/include", + "-I", + "${System.getProperty("java.home")}/include/${dirName()}", + "-I", + "$buildDir/generated/jni", + "-shared", + "-o", + "$outputDirStr/native${extName()}" + )) + + val cppPath = cppSourceDir.toPath() + Files.walk(cppPath) + .map { it.toAbsolutePath().toString() } + .filter { it.endsWith(".cpp") } + .forEach { cmdArgs.add(it) } + + commandLine(cmdArgs) } kotlin { - jvmToolchain(8) + jvmToolchain(17) } tasks.withType { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "17" dependsOn(tasks.generateGrammarSource) } - application { - mainClass.set("MCFPPKt") -} \ No newline at end of file + mainClass.set("top.mcfpp.MCFPPKt") +} + +enum class OperatingSystem { + WINDOWS, + LINUX, + MACOS; + companion object { + private fun isWindows(): Boolean { + val osName = System.getProperty("os.name") + return osName != null && osName.startsWith("Windows") + } + + private fun isMacOs(): Boolean { + val osName = System.getProperty("os.name") + return osName != null && osName.startsWith("Mac") + } + + private fun isLinux(): Boolean { + val osName = System.getProperty("os.name") + return osName != null && osName.startsWith("Linux") + } + + fun current(): Optional { + return when { + isWindows() -> Optional.of(WINDOWS) + isMacOs() -> Optional.of(MACOS) + isLinux() -> Optional.of(LINUX) + else -> Optional.empty() + } + } + } +} diff --git a/gradle.properties b/gradle.properties index 7fc6f1ff..f391c934 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,3 @@ kotlin.code.style=official +#systemProp.https.proxyHost=127.0.0.1 +#systemProp.https.proxyPort=20809 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 60c76b34..76bb2afe 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://maven.fastmirror.net/repositories/gradle-dist/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists \ No newline at end of file +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 diff --git a/log4j2.xml b/log4j2.xml new file mode 100644 index 00000000..99fb2fc5 --- /dev/null +++ b/log4j2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/mcfpp/dynamic/.mclib b/mcfpp/dynamic/.mclib new file mode 100644 index 00000000..e7cc4a3d --- /dev/null +++ b/mcfpp/dynamic/.mclib @@ -0,0 +1,4 @@ +{ + "namespaces":[], + "src":"src" +} \ No newline at end of file diff --git a/mcfpp/dynamic/mcfpp.dynamic.json b/mcfpp/dynamic/mcfpp.dynamic.json new file mode 100644 index 00000000..4dc815c1 --- /dev/null +++ b/mcfpp/dynamic/mcfpp.dynamic.json @@ -0,0 +1,8 @@ +{ + "files": [ + "*" + ], + "description": "", + "namespace": "mcfpp.dynamic", + "targetPath": "null" +} \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/append_number_index.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/append_number_index.mcfunction new file mode 100644 index 00000000..a3ac4ff6 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/append_number_index.mcfunction @@ -0,0 +1,4 @@ +#> mcfpp.dynamic.util:nbt/append_number_index +# @internal + +$data modify storage mcfpp:arg path_join.pathList append value "[$(index)]" \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/join_path.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/join_path.mcfunction new file mode 100644 index 00000000..6f6e3fb8 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/join_path.mcfunction @@ -0,0 +1,13 @@ +#> mcfpp.dynamic.util:nbt/join_path +# @api +# @input storage mcfpp:arg path_join.pathList +# @input storage mcfpp:arg path_join.base +# @output storage mcfpp:arg path_join.base + +execute store result score length mcfpp_temp run data get storage mcfpp:arg pathList + +execute if score length mcfpp_temp matches 0 run return 1 +data modify storage mcfpp:arg path_join.append set from storage mcfpp:arg pathList[0] +function mcfpp.dynamic.util:nbt/z_join with storage mcfpp:arg path_join +data remove storage mcfpp:arg path_join.pathList[0] +function mcfpp.dynamic.util:nbt/join_path \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/z_join.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/z_join.mcfunction new file mode 100644 index 00000000..cebe2071 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic.util/functions/nbt/z_join.mcfunction @@ -0,0 +1,3 @@ +#> mcfpp.dynamic.util:nbt/z_join +# @internal +$data modify storage mcfpp:arg path_join.base set value $(base).$(append) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/everything.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/everything.mcfunction new file mode 100644 index 00000000..be220438 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/everything.mcfunction @@ -0,0 +1 @@ +$advancement $(grant_revoke) $(targets) everything \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/multi.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/multi.mcfunction new file mode 100644 index 00000000..18a4fd71 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/multi.mcfunction @@ -0,0 +1 @@ +$advancement $(grant_revoke) $(targets) $(from_through_until) $(id) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only.mcfunction new file mode 100644 index 00000000..10a1d2bd --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only.mcfunction @@ -0,0 +1 @@ +$advancement $(grant_revoke) $(targets) only $(id) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only_with_criterion.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only_with_criterion.mcfunction new file mode 100644 index 00000000..ac4619a9 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/advancement/only_with_criterion.mcfunction @@ -0,0 +1 @@ +$advancement $(grant_revoke) $(targets) only $(id) $(criterion) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get.mcfunction new file mode 100644 index 00000000..aa2b7164 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get.mcfunction @@ -0,0 +1 @@ +$$(preCommand) attribute $(target) $(id) get \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get_scale.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get_scale.mcfunction new file mode 100644 index 00000000..73bde0e9 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/get_scale.mcfunction @@ -0,0 +1 @@ +$attribute $(target) $(id) get $(scale) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/modifier/add.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/attribute/modifier/add.mcfunction new file mode 100644 index 00000000..e69de29b diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage.mcfunction new file mode 100644 index 00000000..56084f3b --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage.mcfunction @@ -0,0 +1,5 @@ +#> mcfpp.dynamic:data/modify/entity.from.storage +# @api +# @input source sourcePath target targetPath + +$data modify entity $(source) $(sourcePath) set from storage $(target) $(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp.mcfunction new file mode 100644 index 00000000..48a0eefc --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp.mcfunction @@ -0,0 +1,6 @@ +#> mcfpp.dynamic:data/modify/entity.from.storage_sp +# 特别用于mcfpp编译。当nbt a = b时,若ab都是类成员的时候调用此函数。 +# @api +# @input (source=@s) sourcePath (target=mcfpp:temp) targetPath + +$data modify entity @s data.$(sourcePath) set from storage mcfpp:temp temp.$(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp2.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp2.mcfunction new file mode 100644 index 00000000..984f9966 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/entity.from.storage_sp2.mcfunction @@ -0,0 +1,6 @@ +#> mcfpp.dynamic:data/modify/entity.from.storage_sp2 +# 特别用于mcfpp编译。当nbt a = b时,若只有a是类成员的时候调用此函数。 +# @api +# @input (source=@s) sourcePath (target=mcfpp:system) targetPath + +$data modify entity @s $(sourcePath) set from storage mcfpp:system $(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.append.from.entity_sp.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.append.from.entity_sp.mcfunction new file mode 100644 index 00000000..410ce497 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.append.from.entity_sp.mcfunction @@ -0,0 +1,6 @@ +#> mcfpp.dynamic:data/modify/storage.append.from.entity_sp +# 特别用于mcfpp编译。当有s[a.p]时,只有p为一个动态nbt,且为类成员的时候调用 +# @api +# @input path + +$data modify storage mcfpp:arg path_join.pathList append from entity @s $(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp3.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp3.mcfunction new file mode 100644 index 00000000..e689f3ab --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp3.mcfunction @@ -0,0 +1,6 @@ +#> mcfpp.dynamic:data/modify/storage.from.entity_sp3 +# 特别用于mcfpp编译。当nbt a = b时,若只有b是类成员的时候调用此函数。 +# @api +# @input (source=mcfpp:system) sourcePath (target=@s) targetPath + +$data modify storage mcfpp:system $(sourcePath) set from entity @s data.$(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp5.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp5.mcfunction new file mode 100644 index 00000000..d431a1f3 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.entity_sp5.mcfunction @@ -0,0 +1,6 @@ +#> mcfpp.dynamic:data/modify/storage.from.entity_sp3 +# 特别用于mcfpp编译。当nbt a = b时,若只有b是类成员的时候,且a是临时变量的时候调用此函数。 +# @api +# @input (source=mcfpp:temp) sourcePath (target=@s) targetPath + +$data modify storage mcfpp:temp temp.$(sourcePath) set from entity @s data.$(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage.mcfunction new file mode 100644 index 00000000..3cd3c559 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage.mcfunction @@ -0,0 +1,5 @@ +#> mcfpp.dynamic:data/modify/storage.from.storage +# @api +# @input source sourcePath target targetPath + +$data modify storage $(source) $(sourcePath) set from storage $(target) $(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp4.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp4.mcfunction new file mode 100644 index 00000000..766f571c --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp4.mcfunction @@ -0,0 +1,5 @@ +#> mcfpp.dynamic:data/modify/storage.from.storage_sp4 +# @api +# @input (source=mcfpp:system) sourcePath (target=mcfpp:system) targetPath + +$data modify storage mcfpp:sytem $(sourcePath) set from storage mcfpp:sytem $(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp6.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp6.mcfunction new file mode 100644 index 00000000..a81824ad --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/data/modify/storage.from.storage_sp6.mcfunction @@ -0,0 +1,5 @@ +#> mcfpp.dynamic:data/modify/storage.from.storage_sp4 +# @api +# @input (source=mcfpp:temp) sourcePath (target=mcfpp:system) targetPath + +$data modify storage mcfpp:temp temp.$(sourcePath) set from storage mcfpp:system $(targetPath) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/function.mcfunction b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/function.mcfunction new file mode 100644 index 00000000..7ea88bb5 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/data/mcfpp.dynamic/functions/function.mcfunction @@ -0,0 +1,4 @@ +#> mcfpp.dynamic:function +# @api +# @input id +$function $(id) \ No newline at end of file diff --git a/mcfpp/dynamic/src/DynamicCommand/pack.mcmeta b/mcfpp/dynamic/src/DynamicCommand/pack.mcmeta new file mode 100644 index 00000000..d90b88c7 --- /dev/null +++ b/mcfpp/dynamic/src/DynamicCommand/pack.mcmeta @@ -0,0 +1,7 @@ +{ + "pack": { + "pack_format": 50, + "description": "Dynamic Command Pack" + } + } + \ No newline at end of file diff --git a/mcfpp/lang/main.mcfpp b/mcfpp/lang/main.mcfpp new file mode 100644 index 00000000..e69de29b diff --git a/mcfpp/math/.mclib b/mcfpp/math/.mclib new file mode 100644 index 00000000..e7cc4a3d --- /dev/null +++ b/mcfpp/math/.mclib @@ -0,0 +1,4 @@ +{ + "namespaces":[], + "src":"src" +} \ No newline at end of file diff --git a/mcfpp/math/mcfpp.math.json b/mcfpp/math/mcfpp.math.json new file mode 100644 index 00000000..0fcf5bb3 --- /dev/null +++ b/mcfpp/math/mcfpp.math.json @@ -0,0 +1,8 @@ +{ + "files": [ + "*" + ], + "description": "", + "namespace": "mcfpp.math", + "targetPath": "null" +} \ No newline at end of file diff --git a/mcfpp/math/src/math/README.md b/mcfpp/math/src/math/README.md new file mode 100644 index 00000000..4d7d6d0d --- /dev/null +++ b/mcfpp/math/src/math/README.md @@ -0,0 +1,8 @@ +# MCFPP标准数学库 MCFPP Standard Math Library +MCFPP标准数学库是基于[小豆数学库2.0](https://github.com/xiaodou8593/math2.0)部分删减而成,其中代码的版权和归属权完全属于小豆。MCFPP根据GPL 3.0协议将其纳入MCFPP的标准数学库中。原数据包体型过于庞大,为了避免加载缓慢的问题,将其拆解为多个功能性数据包进行加载。 + +The MCFPP Standard Math Library is based on the modification of [xiaodou's math lib version 2.0](https://github.com/xiaodou8593/math2.0), and the copyright and ownership of the code belongs entirely to xiaodou8593. MCFPP incorporates it into its standard math library under the GPL 3.0 license. The original data package was too large, so it was split into multiple functional data packages to avoid slow loading. + +## 使用特性 +* 单精度浮点数 +* 基本数学函数 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls1.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls1.json new file mode 100644 index 00000000..5e337c12 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls1.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:cat", + "minecraft:ocelot", + "minecraft:fox" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls10.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls10.json new file mode 100644 index 00000000..8238e1d5 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls10.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "minecraft:experience_orb", + "minecraft:arrow", + "minecraft:spectral_arrow", + "minecraft:trident" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls11.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls11.json new file mode 100644 index 00000000..3e79875f --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls11.json @@ -0,0 +1,12 @@ +{ + "replace": false, + "values": [ + "minecraft:evoker", + "minecraft:illusioner", + "minecraft:piglin_brute", + "minecraft:pillager", + "minecraft:vindicator", + "minecraft:wandering_trader", + "minecraft:witch" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls12.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls12.json new file mode 100644 index 00000000..fd768873 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls12.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:skeleton", + "minecraft:stray" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls13.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls13.json new file mode 100644 index 00000000..b9ab0445 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls13.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:glow_squid", + "minecraft:squid" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls14.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls14.json new file mode 100644 index 00000000..c256f245 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls14.json @@ -0,0 +1,12 @@ +{ + "replace": false, + "values": [ + "minecraft:minecart", + "minecraft:chest_minecart", + "minecraft:command_block_minecart", + "minecraft:furnace_minecart", + "minecraft:hopper_minecart", + "minecraft:spawner_minecart", + "minecraft:tnt_minecart" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls15.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls15.json new file mode 100644 index 00000000..8cbc37fb --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls15.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "minecraft:dragon_fireball", + "minecraft:falling_block", + "minecraft:fireball", + "minecraft:tnt" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls16.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls16.json new file mode 100644 index 00000000..5519569c --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls16.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:boat", + "minecraft:chest_boat" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls2.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls2.json new file mode 100644 index 00000000..d4863cb1 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls2.json @@ -0,0 +1,12 @@ +{ + "replace": false, + "values": [ + "minecraft:drowned", + "minecraft:husk", + "minecraft:villager", + "minecraft:piglin", + "minecraft:zombie", + "minecraft:zombie_villager", + "minecraft:zombified_piglin" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls3.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls3.json new file mode 100644 index 00000000..75b5f611 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls3.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:cow", + "minecraft:mooshroom" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls4.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls4.json new file mode 100644 index 00000000..61240083 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls4.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + "minecraft:horse", + "minecraft:mule", + "minecraft:zombie_horse", + "minecraft:skeleton_horse" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls5.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls5.json new file mode 100644 index 00000000..4d1e2b0f --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls5.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "minecraft:block_display", + "minecraft:item_display", + "minecraft:text_display", + "minecraft:marker", + "minecraft:lightning_bolt" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls6.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls6.json new file mode 100644 index 00000000..eaf2bec4 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls6.json @@ -0,0 +1,15 @@ +{ + "replace": false, + "values": [ + "minecraft:item", + "minecraft:egg", + "minecraft:ender_pearl", + "minecraft:experience_bottle", + "minecraft:eye_of_ender", + "minecraft:snowball", + "minecraft:firework_rocket", + "minecraft:firework_rocket", + "minecraft:fishing_bobber", + "minecraft:llama_spit" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls7.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls7.json new file mode 100644 index 00000000..acb7c1dc --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls7.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:small_fireball", + "minecraft:wither_skull", + "minecraft:shulker_bullet" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls8.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls8.json new file mode 100644 index 00000000..8161af7d --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls8.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "minecraft:endermite", + "minecraft:silverfish", + "minecraft:tadpole" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls9.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls9.json new file mode 100644 index 00000000..e6700767 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/cls9.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "minecraft:bat", + "minecraft:parrot" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen1.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen1.json new file mode 100644 index 00000000..32a81b23 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen1.json @@ -0,0 +1,17 @@ +{ + "replace": false, + "values": [ + "minecraft:area_effect_cloud", + "minecraft:interaction", + "minecraft:slime", + "minecraft:magma_cube", + "minecraft:phantom", + "minecraft:armor_stand", + "minecraft:glow_item_frame", + "minecraft:item_frame", + "minecraft:painting", + "minecraft:shulker", + "minecraft:player", + "minecraft:pufferfish" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen2.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen2.json new file mode 100644 index 00000000..756ab34f --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen2.json @@ -0,0 +1,25 @@ +{ + "replace": false, + "values": [ + "minecraft:rabbit", + "#entitycls:cbox/cls1", + "minecraft:bee", + "minecraft:wolf", + "#entitycls:cbox/cls2", + "minecraft:chicken", + "minecraft:pig", + "minecraft:sheep", + "#entitycls:cbox/cls3", + "minecraft:llama", + "minecraft:turtle", + "minecraft:goat", + "minecraft:panda", + "minecraft:hoglin", + "minecraft:donkey", + "#entitycls:cbox/cls4", + "minecraft:zoglin", + "minecraft:polar_bear", + "minecraft:camel", + "minecraft:sniffer" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen3.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen3.json new file mode 100644 index 00000000..4a5be5ca --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen3.json @@ -0,0 +1,26 @@ +{ + "replace": false, + "values": [ + "#entitycls:cbox/cls5", + "#entitycls:cbox/cls6", + "#entitycls:cbox/cls7", + "minecraft:leash_knot", + "#entitycls:cbox/cls8", + "minecraft:salmon", + "minecraft:vex", + "minecraft:cod", + "minecraft:tropical_fish", + "minecraft:frog", + "minecraft:evoker_fangs", + "#entitycls:cbox/cls9", + "#entitycls:cbox/cls10", + "minecraft:allay", + "minecraft:creeper", + "minecraft:blaze", + "#entitycls:cbox/cls11", + "#entitycls:cbox/cls12", + "minecraft:enderman", + "minecraft:snow_golem", + "minecraft:wither_skeleton" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen4.json b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen4.json new file mode 100644 index 00000000..f5f45ea3 --- /dev/null +++ b/mcfpp/math/src/math/data/entitycls/tags/entity_types/cbox/gen4.json @@ -0,0 +1,25 @@ +{ + "replace": false, + "values": [ + "minecraft:cave_spider", + "minecraft:axolotl", + "#entitycls:cbox/cls13", + "minecraft:guardian", + "minecraft:dolphin", + "minecraft:strider", + "minecraft:trader_llama", + "minecraft:warden", + "minecraft:wither", + "#entitycls:cbox/cls14", + "#entitycls:cbox/cls15", + "#entitycls:cbox/cls16", + "minecraft:spider", + "minecraft:iron_golem", + "minecraft:ravager", + "minecraft:elder_guardian", + "minecraft:end_crystal", + "minecraft:giant", + "minecraft:ghast", + "minecraft:ender_dragon" + ] +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/entitycls/version_1.19.4.txt b/mcfpp/math/src/math/data/entitycls/version_1.19.4.txt new file mode 100644 index 00000000..e69de29b diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_coordto.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_coordto.mcfunction new file mode 100644 index 00000000..80cf34bd --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_coordto.mcfunction @@ -0,0 +1,10 @@ +#math:3vec/_coordto +# 转换函数:将执行坐标转换为3vec +# 需要传入世界实体为执行者 +# 输入:执行坐标 +# 输出:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>} + +tp @s ~ ~ ~ +execute store result score 3vec_x int run data get entity @s Pos[0] 10000 +execute store result score 3vec_y int run data get entity @s Pos[1] 10000 +execute store result score 3vec_z int run data get entity @s Pos[2] 10000 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_cross.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_cross.mcfunction new file mode 100644 index 00000000..aa7b2e08 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_cross.mcfunction @@ -0,0 +1,23 @@ +#math:3vec/_cross +scoreboard players operation stempx int = 3vec_x int +scoreboard players operation 3vec_x int = 3vec_y int +scoreboard players operation 3vec_x int *= @s 3vec_z +scoreboard players operation stemp0 int = @s 3vec_y +scoreboard players operation stemp0 int *= 3vec_z int +scoreboard players operation 3vec_x int -= stemp0 int +scoreboard players operation 3vec_x int /= 10000 int + +scoreboard players operation stempy int = 3vec_y int +scoreboard players operation 3vec_y int = 3vec_z int +scoreboard players operation 3vec_y int *= @s 3vec_x +scoreboard players operation stemp0 int = @s 3vec_z +scoreboard players operation stemp0 int *= stempx int +scoreboard players operation 3vec_y int -= stemp0 int +scoreboard players operation 3vec_y int /= 10000 int + +scoreboard players operation 3vec_z int = stempx int +scoreboard players operation 3vec_z int *= @s 3vec_y +scoreboard players operation stemp0 int = @s 3vec_x +scoreboard players operation stemp0 int *= stempy int +scoreboard players operation 3vec_z int -= stemp0 int +scoreboard players operation 3vec_z int /= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_dsp-ex.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_dsp-ex.mcfunction new file mode 100644 index 00000000..cd5ad077 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_dsp-ex.mcfunction @@ -0,0 +1,7 @@ +#math:3vec/_dsp-ex +# 扩展函数:对3vec进行球坐标属性扩展,并对3vec进行粒子显示 +# 需要传入世界实体为执行者 +# 输入:,3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_n,int>} + +function math:3vec/_ex-rot +function math:3vec/_dsp \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_dsp.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_dsp.mcfunction new file mode 100644 index 00000000..68881f6e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_dsp.mcfunction @@ -0,0 +1,31 @@ +#math:3vec/_dsp +# 对3vec进行粒子显示 +# 需要传入世界实体为执行者 +# 输入:,3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_n,int>,<3vec_l,int>} + +execute store result entity @s Pos[0] double 0.0001 run scoreboard players operation stemp0 int = 3vec_x int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players operation stemp1 int = 3vec_y int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players operation stemp2 int = 3vec_z int +scoreboard players operation stemp3 int = stemp0 int +scoreboard players operation stemp4 int = stemp1 int +scoreboard players operation stemp5 int = stemp2 int +scoreboard players operation stemp3 int %= 3vec_n int +scoreboard players operation stemp4 int %= 3vec_n int +scoreboard players operation stemp5 int %= 3vec_n int +scoreboard players operation stemp0 int /= 3vec_n int +scoreboard players operation stemp1 int /= 3vec_n int +scoreboard players operation stemp2 int /= 3vec_n int +execute positioned 0.0 0.0 0.0 facing entity @s feet run tp @s ~ ~ ~ ~ ~ + +tp @s ~ ~ ~ +execute store result score sstemp0 int run data get entity @s Pos[0] 10000 +execute store result score sstemp1 int run data get entity @s Pos[1] 10000 +execute store result score sstemp2 int run data get entity @s Pos[2] 10000 + +scoreboard players set sstemp3 int 0 +scoreboard players set sstemp4 int 0 +scoreboard players set sstemp5 int 0 +scoreboard players set sloop int 0 +execute if score sloop int < 3vec_n int run function math:3vec/dsp/loop0 + +execute if entity @p at @s run function math:3vec/dsp/arrow \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_ex-len.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_ex-len.mcfunction new file mode 100644 index 00000000..1f1441a6 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_ex-len.mcfunction @@ -0,0 +1,39 @@ +#math:3vec/_ex-rot +# 扩展函数:对3vec进行长度属性扩展 +# 输入:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>} +# 输出:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_l,int>} + +scoreboard players operation stempx int = 3vec_x int +scoreboard players operation stempy int = 3vec_y int +scoreboard players operation stempz int = 3vec_z int + +scoreboard players set stemp4 int 0 +execute unless score 3vec_x int matches -26754..26754 run scoreboard players set stemp4 int 1 +execute unless score 3vec_y int matches -26754..26754 run scoreboard players set stemp4 int 1 +execute unless score 3vec_z int matches -26754..26754 run scoreboard players set stemp4 int 1 +execute if score stemp4 int matches 1 run function math:3vec/exlen/3div + +scoreboard players operation stempx int *= stempx int +scoreboard players operation stempy int *= stempy int +scoreboard players operation stempz int *= stempz int +scoreboard players operation stempx int += stempy int +scoreboard players operation stempx int += stempz int + +execute store result score stemp0 int store result score stemp1 int store result score stemp2 int store result score stemp3 int run scoreboard players operation 3vec_l int = stempx int +execute if score stempx int matches ..13924 run function math:3vec/exlen/range0 +execute if score stempx int matches 13925..16777216 run function math:3vec/exlen/range1 +execute if score stempx int matches 16777217.. run function math:3vec/exlen/range2 +scoreboard players operation stemp0 int /= 3vec_l int +scoreboard players operation 3vec_l int += stemp0 int +scoreboard players operation 3vec_l int /= 2 int +scoreboard players operation stemp1 int /= 3vec_l int +scoreboard players operation 3vec_l int += stemp1 int +scoreboard players operation 3vec_l int /= 2 int +scoreboard players operation stemp2 int /= 3vec_l int +scoreboard players operation 3vec_l int += stemp2 int +scoreboard players operation 3vec_l int /= 2 int +scoreboard players operation stemp3 int /= 3vec_l int +scoreboard players operation 3vec_l int += stemp3 int +scoreboard players operation 3vec_l int /= 2 int + +execute if score stemp4 int matches 1 run scoreboard players operation 3vec_l int *= 10 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_ex-rot.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_ex-rot.mcfunction new file mode 100644 index 00000000..6e7c676e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_ex-rot.mcfunction @@ -0,0 +1,43 @@ +#math:3vec/_ex-rot +# 扩展函数:对3vec进行球坐标属性扩展 +# 输入:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>} +# 输出:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_rot0,int>,<3vec_rot1,int>,<3vec_l,int>} + +#获得单位方向向量以及朝向 +execute store result entity @s Pos[0] double 0.0001 run scoreboard players get 3vec_x int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players get 3vec_y int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players get 3vec_z int +execute positioned 0.0 0.0 0.0 facing entity @s feet run tp @s ^ ^ ^1.0 ~ ~ + +#把朝向输出到方向角 +execute store result score 3vec_rot0 int run data get entity @s Rotation[0] 10000 +execute store result score 3vec_rot1 int run data get entity @s Rotation[1] 10000 + +#单位方向向量转换为临时分数 +execute store result score stempi0 int run data get entity @s Pos[0] 10000 +execute store result score stempi1 int run data get entity @s Pos[1] 10000 +execute store result score stempi2 int run data get entity @s Pos[2] 10000 + +#求坐标的绝对值和 +scoreboard players operation 3vec_l int = 3vec_x int +execute if score 3vec_x int matches ..-1 run scoreboard players operation 3vec_l int *= -1 int +execute if score 3vec_y int matches 1.. run scoreboard players operation 3vec_l int += 3vec_y int +execute if score 3vec_y int matches ..-1 run scoreboard players operation 3vec_l int -= 3vec_y int +execute if score 3vec_z int matches 1.. run scoreboard players operation 3vec_l int += 3vec_z int +execute if score 3vec_z int matches ..-1 run scoreboard players operation 3vec_l int -= 3vec_z int + +#求单位向量坐标的绝对值和 +execute if score stempi0 int matches ..-1 run scoreboard players operation stempi0 int *= -1 int +execute if score stempi1 int matches ..-1 run scoreboard players operation stempi1 int *= -1 int +execute if score stempi2 int matches ..-1 run scoreboard players operation stempi2 int *= -1 int +scoreboard players operation stempi0 int += stempi1 int +scoreboard players operation stempi0 int += stempi2 int + +#绝对值相除获得模长 +scoreboard players operation stemp0 int = 3vec_l int +scoreboard players operation 3vec_l int /= stempi0 int +scoreboard players operation 3vec_l int *= 10000 int +scoreboard players operation stemp0 int %= stempi0 int +scoreboard players operation stemp0 int *= 10000 int +scoreboard players operation stemp0 int /= stempi0 int +scoreboard players operation 3vec_l int += stemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_ex-xyz.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_ex-xyz.mcfunction new file mode 100644 index 00000000..ea150777 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_ex-xyz.mcfunction @@ -0,0 +1,42 @@ +#math:3vec/_ex-xyz +# 扩展函数:对3vec进行直角坐标属性扩展 +# 输入:3vec{<3vec_rot0,int>,<3vec_rot1,int>,<3vec_l,int>} +# 输出:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_rot0,int>,<3vec_rot1,int>,<3vec_l,int>} + +#获得单位方向向量 +execute store result entity @s Rotation[0] float 0.0001 run scoreboard players get 3vec_rot0 int +execute store result entity @s Rotation[1] float 0.0001 run scoreboard players get 3vec_rot1 int +execute rotated as @s positioned 0.0 0.0 0.0 run tp @s ^ ^ ^1.0 + +#对单位向量的x分量乘模长得到x坐标 +execute store result score 3vec_x int run data get entity @s Pos[0] 10000 +scoreboard players operation stemp0 int = 3vec_l int +scoreboard players operation stemp1 int = 3vec_l int +scoreboard players operation stemp0 int /= 10000 int +scoreboard players operation stemp1 int %= 10000 int +scoreboard players operation stemp1 int *= 3vec_x int +scoreboard players operation stemp1 int /= 10000 int +scoreboard players operation 3vec_x int *= stemp0 int +scoreboard players operation 3vec_x int += stemp1 int + +#对单位向量的y分量乘模长得到y坐标 +execute store result score 3vec_y int run data get entity @s Pos[1] 10000 +scoreboard players operation stemp0 int = 3vec_l int +scoreboard players operation stemp1 int = 3vec_l int +scoreboard players operation stemp0 int /= 10000 int +scoreboard players operation stemp1 int %= 10000 int +scoreboard players operation stemp1 int *= 3vec_y int +scoreboard players operation stemp1 int /= 10000 int +scoreboard players operation 3vec_y int *= stemp0 int +scoreboard players operation 3vec_y int += stemp1 int + +#对单位向量的z分量乘模长得到z坐标 +execute store result score 3vec_z int run data get entity @s Pos[2] 10000 +scoreboard players operation stemp0 int = 3vec_l int +scoreboard players operation stemp1 int = 3vec_l int +scoreboard players operation stemp0 int /= 10000 int +scoreboard players operation stemp1 int %= 10000 int +scoreboard players operation stemp1 int *= 3vec_z int +scoreboard players operation stemp1 int /= 10000 int +scoreboard players operation 3vec_z int *= stemp0 int +scoreboard players operation 3vec_z int += stemp1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_facingto.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_facingto.mcfunction new file mode 100644 index 00000000..162b24dd --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_facingto.mcfunction @@ -0,0 +1,6 @@ +#math:3vec/_facingto +#需要传入世界实体为执行者 +execute positioned 0.0 0.0 0.0 run tp @s ^ ^ ^1.0 +execute store result score 3vec_x int run data get entity @s Pos[0] 10000 +execute store result score 3vec_y int run data get entity @s Pos[1] 10000 +execute store result score 3vec_z int run data get entity @s Pos[2] 10000 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_fposto.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_fposto.mcfunction new file mode 100644 index 00000000..bb841af5 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_fposto.mcfunction @@ -0,0 +1,4 @@ +#math:3vec/_fposto +execute store result score 3vec_x int run data get entity @s Pos[0] 10000 +execute store result score 3vec_y int run data get entity @s Pos[1] 10000 +execute store result score 3vec_z int run data get entity @s Pos[2] 10000 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_get.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_get.mcfunction new file mode 100644 index 00000000..27663b5d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_get.mcfunction @@ -0,0 +1,7 @@ +#math:3vec/_get +scoreboard players operation 3vec_x int = @s 3vec_x +scoreboard players operation 3vec_y int = @s 3vec_y +scoreboard players operation 3vec_z int = @s 3vec_z +scoreboard players operation 3vec_rot0 int = @s 3vec_rot0 +scoreboard players operation 3vec_rot1 int = @s 3vec_rot1 +scoreboard players operation 3vec_l int = @s 3vec_l \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_ldsp-ex.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_ldsp-ex.mcfunction new file mode 100644 index 00000000..738badff --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_ldsp-ex.mcfunction @@ -0,0 +1,6 @@ +#math:3vec/_ldsp-ex +#扩展函数:对3vec进行球坐标属性扩展,并对3vec进行粒子显示 +#需要传入世界实体为执行者 +#输入:,3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_n,int>} +function math:3vec/_ex-rot +function math:3vec/_ldsp \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_ldsp.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_ldsp.mcfunction new file mode 100644 index 00000000..e34a37b8 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_ldsp.mcfunction @@ -0,0 +1,29 @@ +#math:3vec/_ldsp +# 对3vec进行无箭头粒子显示 +# 需要传入世界实体为执行者 + +#输入:,3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_n,int>,<3vec_l,int>} +execute store result entity @s Pos[0] double 0.0001 run scoreboard players operation stemp0 int = 3vec_x int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players operation stemp1 int = 3vec_y int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players operation stemp2 int = 3vec_z int +scoreboard players operation stemp3 int = stemp0 int +scoreboard players operation stemp4 int = stemp1 int +scoreboard players operation stemp5 int = stemp2 int +scoreboard players operation stemp3 int %= 3vec_n int +scoreboard players operation stemp4 int %= 3vec_n int +scoreboard players operation stemp5 int %= 3vec_n int +scoreboard players operation stemp0 int /= 3vec_n int +scoreboard players operation stemp1 int /= 3vec_n int +scoreboard players operation stemp2 int /= 3vec_n int +execute positioned 0.0 0.0 0.0 facing entity @s feet run tp @s ~ ~ ~ ~ ~ + +tp @s ~ ~ ~ +execute store result score sstemp0 int run data get entity @s Pos[0] 10000 +execute store result score sstemp1 int run data get entity @s Pos[1] 10000 +execute store result score sstemp2 int run data get entity @s Pos[2] 10000 + +scoreboard players set sstemp3 int 0 +scoreboard players set sstemp4 int 0 +scoreboard players set sstemp5 int 0 +scoreboard players set sloop int 0 +execute if score sloop int < 3vec_n int run function math:3vec/dsp/loop0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_polar.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_polar.mcfunction new file mode 100644 index 00000000..b7a700c3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_polar.mcfunction @@ -0,0 +1,48 @@ +#math:3vec/_polar +# 规整化三维向量 +# 输入:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>} +# 输出:正方体半边长到 +# 输出:规整化后的三维向量{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>} +# 输出:筛离出的平面表面坐标{<@s,3vec_x>,<@s,3vec_y>,<@s,3vec_z>} +# 为避免顶点或者边上的情况被规整化为(1,1,1)或(1,1,0),可以在外部使用以下命令: +# execute if score 3vec_x int = 3vec_z int run scoreboard players set 3vec_x int 0 +# execute if score 3vec_x int = 3vec_y int run scoreboard players set 3vec_x int 0 +# execute if score 3vec_y int = 3vec_z int run scoreboard players set 3vec_y int 0 + +execute store result score @s 3vec_x run scoreboard players operation stempx int = 3vec_x int +execute store result score @s 3vec_y run scoreboard players operation stempy int = 3vec_y int +execute store result score @s 3vec_z run scoreboard players operation stempz int = 3vec_z int +execute if score 3vec_x int matches ..-1 run scoreboard players operation stempx int *= -1 int +execute if score 3vec_y int matches ..-1 run scoreboard players operation stempy int *= -1 int +execute if score 3vec_z int matches ..-1 run scoreboard players operation stempz int *= -1 int + +scoreboard players operation 3vec_x int /= stempx int +scoreboard players operation 3vec_y int /= stempy int +scoreboard players operation 3vec_z int /= stempz int + +#最大绝对值 +scoreboard players operation stempd int = stempx int +execute if score stempy int > stempd int run scoreboard players operation stempd int = stempy int +execute if score stempz int > stempd int run scoreboard players operation stempd int = stempz int + +#极化法向量 +scoreboard players operation stempx int /= stempd int +scoreboard players operation stempy int /= stempd int +scoreboard players operation stempz int /= stempd int + +execute store result score stempx int run scoreboard players operation 3vec_x int *= stempx int +execute store result score stempy int run scoreboard players operation 3vec_y int *= stempy int +execute store result score stempy int run scoreboard players operation 3vec_z int *= stempz int + +#0/1取反 +scoreboard players add stempx int 1 +scoreboard players add stempy int 1 +scoreboard players add stempz int 1 +scoreboard players operation stempx int %= 2 int +scoreboard players operation stempy int %= 2 int +scoreboard players operation stempz int %= 2 int + +#筛离表面坐标 +scoreboard players operation @s 3vec_x *= stempx int +scoreboard players operation @s 3vec_y *= stempy int +scoreboard players operation @s 3vec_z *= stempz int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_posto.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_posto.mcfunction new file mode 100644 index 00000000..d21e0298 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_posto.mcfunction @@ -0,0 +1,11 @@ +#math:3vec/_posto +# 转换函数:将执行者坐标转换为3vec +# 输入:执行者坐标 +# 输出:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>} + +execute store result score 3vec_x int run data get entity @s Pos[0] 10000 +execute store result score 3vec_y int run data get entity @s Pos[1] 10000 +execute store result score 3vec_z int run data get entity @s Pos[2] 10000 +scoreboard players operation 3vec_x int -= x int +scoreboard players operation 3vec_y int -= y int +scoreboard players operation 3vec_z int -= z int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_print.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_print.mcfunction new file mode 100644 index 00000000..f4fe2883 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_print.mcfunction @@ -0,0 +1,2 @@ +#math:3vec/_print +tellraw @a [{"text":"(3vec) @s: ["},{"score":{"name":"@s","objective":"3vec_x"}},{"text":","},{"score":{"name":"@s","objective":"3vec_y"}},{"text":","},{"score":{"name":"@s","objective":"3vec_z"}},{"text":"]"}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_ssprint.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_ssprint.mcfunction new file mode 100644 index 00000000..fd58e353 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_ssprint.mcfunction @@ -0,0 +1,2 @@ +#math:3vec/_ssprint +tellraw @a [{"text":"(3vec) ssobj: ["},{"score":{"name":"3vec_x","objective":"int"}},{"text":","},{"score":{"name":"3vec_y","objective":"int"}},{"text":","},{"score":{"name":"3vec_z","objective":"int"}},{"text":"]"}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_ssrandnew.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_ssrandnew.mcfunction new file mode 100644 index 00000000..e6725d54 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_ssrandnew.mcfunction @@ -0,0 +1,9 @@ +#math:3vec/_ssrandnew +scoreboard players set min int -30000 +scoreboard players set max int 30000 +function math:_random +scoreboard players operation 3vec_x int = random int +function math:_random +scoreboard players operation 3vec_y int = random int +function math:_random +scoreboard players operation 3vec_z int = random int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_store.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_store.mcfunction new file mode 100644 index 00000000..962fd823 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_store.mcfunction @@ -0,0 +1,7 @@ +#math:3vec/_store +scoreboard players operation @s 3vec_x = 3vec_x int +scoreboard players operation @s 3vec_y = 3vec_y int +scoreboard players operation @s 3vec_z = 3vec_z int +scoreboard players operation @s 3vec_rot0 = 3vec_rot0 int +scoreboard players operation @s 3vec_rot1 = 3vec_rot1 int +scoreboard players operation @s 3vec_l = 3vec_l int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_tofacing.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_tofacing.mcfunction new file mode 100644 index 00000000..4ad9dd8c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_tofacing.mcfunction @@ -0,0 +1,6 @@ +#math:3vec/_tofacing +#需要传入世界实体为执行者 +execute store result entity @s Pos[0] double 0.0001 run scoreboard players get 3vec_x int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players get 3vec_y int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players get 3vec_z int +execute positioned 0.0 0.0 0.0 facing entity @s feet run tp @s ~ ~ ~ ~ ~ \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_tofpos.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_tofpos.mcfunction new file mode 100644 index 00000000..27df9b75 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_tofpos.mcfunction @@ -0,0 +1,4 @@ +#math:3vec/_tofpos +execute store result entity @s Pos[0] double 0.0001 run scoreboard players get 3vec_x int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players get 3vec_y int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players get 3vec_z int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_topos.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_topos.mcfunction new file mode 100644 index 00000000..d2f44ec6 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_topos.mcfunction @@ -0,0 +1,11 @@ +#math:3vec/_topos +# 转换函数:将3vec转换为执行者坐标 +# 输入:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>} +# 输出:执行者坐标 + +scoreboard players operation stempx int = x int +scoreboard players operation stempy int = y int +scoreboard players operation stempz int = z int +execute store result entity @s Pos[0] double 0.0001 run scoreboard players operation stempx int += 3vec_x int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players operation stempy int += 3vec_y int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players operation stempz int += 3vec_z int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/_tosto.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/_tosto.mcfunction new file mode 100644 index 00000000..46ddde6b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/_tosto.mcfunction @@ -0,0 +1,13 @@ +#math:3vec/_tosto +#转换函数:将3vec转换为nbt形式 +#输入:3vec{<3vec_x,int>,<3vec_y,int>,<3vec_z,int>,<3vec_rot0,int>,<3vec_rot1,int>,<3vec_l,int>,<3vec_n,int>} +#输出:nbt_3vec{[3list_double,3vec.xyz],[3list_double,3vec.rot],[int,3vec.n]} +execute store result storage math:io 3vec.xyz[0] double 0.0001 run scoreboard players get 3vec_x int +execute store result storage math:io 3vec.xyz[1] double 0.0001 run scoreboard players get 3vec_y int +execute store result storage math:io 3vec.xyz[2] double 0.0001 run scoreboard players get 3vec_z int + +execute store result storage math:io 3vec.rot[0] double 0.0001 run scoreboard players get 3vec_rot0 int +execute store result storage math:io 3vec.rot[1] double 0.0001 run scoreboard players get 3vec_rot1 int +execute store result storage math:io 3vec.rot[2] double 0.0001 run scoreboard players get 3vec_l int + +execute store result storage math:io 3vec.n int 1 run scoreboard players get 3vec_n int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/dsp/arrow.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/dsp/arrow.mcfunction new file mode 100644 index 00000000..99b59a25 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/dsp/arrow.mcfunction @@ -0,0 +1,148 @@ +execute positioned 0.0 0.0 0.0 run tp @s ^ ^ ^-1.0 +execute store result score stemp0 int run data get entity @s Pos[0] 10000 +execute store result score stemp1 int run data get entity @s Pos[1] 10000 +execute store result score stemp2 int run data get entity @s Pos[2] 10000 +scoreboard players operation stemp3 int = stemp0 int +scoreboard players operation stemp4 int = stemp1 int +scoreboard players operation stemp5 int = stemp2 int +scoreboard players operation sstemp3 int = sstemp0 int +scoreboard players operation sstemp4 int = sstemp1 int +scoreboard players operation sstemp5 int = sstemp2 int + +execute positioned 0.0 0.0 0.0 run tp @s ^-1.0 ^ ^ +execute store result score stempi0 int run data get entity @s Pos[0] 10000 +execute store result score stempi1 int run data get entity @s Pos[1] 10000 +execute store result score stempi2 int run data get entity @s Pos[2] 10000 + +execute positioned 0.0 0.0 0.0 run tp @s ^ ^1.0 ^ +execute store result score stempj0 int run data get entity @s Pos[0] 10000 +execute store result score stempj1 int run data get entity @s Pos[1] 10000 +execute store result score stempj2 int run data get entity @s Pos[2] 10000 + +execute facing entity @p eyes positioned 0.0 0.0 0.0 run tp @s ^ ^ ^1.0 +execute store result score stempx int run data get entity @s Pos[0] 10000 +execute store result score stempy int run data get entity @s Pos[1] 10000 +execute store result score stempz int run data get entity @s Pos[2] 10000 + +scoreboard players operation stempu int = stempx int +scoreboard players operation stempu int *= stempi0 int +scoreboard players operation stemp6 int = stempy int +scoreboard players operation stemp6 int *= stempi1 int +scoreboard players operation stempu int += stemp6 int +scoreboard players operation stemp6 int = stempz int +scoreboard players operation stemp6 int *= stempi2 int +execute store result entity @s Pos[2] double 0.00000001 run scoreboard players operation stempu int += stemp6 int + +scoreboard players operation stempv int = stempx int +scoreboard players operation stempv int *= stempj0 int +scoreboard players operation stemp6 int = stempy int +scoreboard players operation stemp6 int *= stempj1 int +scoreboard players operation stempv int += stemp6 int +scoreboard players operation stemp6 int = stempz int +scoreboard players operation stemp6 int *= stempj2 int +execute store result entity @s Pos[0] double 0.00000001 run scoreboard players operation stempv int += stemp6 int + +execute positioned 0.0 0.0 0.0 facing entity @s feet rotated ~90.0 0.0 run tp @s ^ ^ ^1.0 +execute store result score stempu int run data get entity @s Pos[2] 10000 +execute store result score stempv int run data get entity @s Pos[0] 10000 + +scoreboard players operation stempi0 int *= stempu int +scoreboard players operation stempj0 int *= stempv int +scoreboard players operation stempi0 int += stempj0 int +scoreboard players operation stempi1 int *= stempu int +scoreboard players operation stempj1 int *= stempv int +scoreboard players operation stempi1 int += stempj1 int +scoreboard players operation stempi2 int *= stempu int +scoreboard players operation stempj2 int *= stempv int +scoreboard players operation stempi2 int += stempj2 int +scoreboard players operation stempi0 int /= 12500 int +scoreboard players operation stempi1 int /= 12500 int +scoreboard players operation stempi2 int /= 12500 int + +scoreboard players operation stempn int = 3vec_n int +scoreboard players operation stempn int /= 5 int + +execute store result entity @s Pos[0] double 0.0001 run scoreboard players operation stemp0 int += stempi0 int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players operation stemp1 int += stempi1 int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players operation stemp2 int += stempi2 int + +execute positioned 0.0 0.0 0.0 facing entity @s feet run tp @s ^ ^ ^1.0 +execute store result score stemp0 int run data get entity @s Pos[0] 10000 +execute store result score stemp1 int run data get entity @s Pos[1] 10000 +execute store result score stemp2 int run data get entity @s Pos[2] 10000 + +scoreboard players operation stemp6 int = 3vec_l int +scoreboard players operation stemp7 int = 3vec_l int +scoreboard players operation stemp6 int /= 10000 int +scoreboard players operation stemp7 int %= 10000 int + +scoreboard players operation stemp8 int = stemp0 int +scoreboard players operation stemp0 int *= stemp6 int +scoreboard players operation stemp8 int *= stemp7 int +scoreboard players operation stemp8 int /= 10000 int +scoreboard players operation stemp0 int += stemp8 int +scoreboard players operation stemp0 int /= 3vec_n int + +scoreboard players operation stemp8 int = stemp1 int +scoreboard players operation stemp1 int *= stemp6 int +scoreboard players operation stemp8 int *= stemp7 int +scoreboard players operation stemp8 int /= 10000 int +scoreboard players operation stemp1 int += stemp8 int +scoreboard players operation stemp1 int /= 3vec_n int + +scoreboard players operation stemp8 int = stemp2 int +scoreboard players operation stemp2 int *= stemp6 int +scoreboard players operation stemp8 int *= stemp7 int +scoreboard players operation stemp8 int /= 10000 int +scoreboard players operation stemp2 int += stemp8 int +scoreboard players operation stemp2 int /= 3vec_n int + +scoreboard players set sloop int 0 +execute if score sloop int < stempn int run function math:3vec/dsp/loop1 + +scoreboard players operation stemp0 int = stemp3 int +scoreboard players operation stemp1 int = stemp4 int +scoreboard players operation stemp2 int = stemp5 int +scoreboard players operation sstemp0 int = sstemp3 int +scoreboard players operation sstemp1 int = sstemp4 int +scoreboard players operation sstemp2 int = sstemp5 int + +execute store result entity @s Pos[0] double 0.0001 run scoreboard players operation stemp0 int -= stempi0 int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players operation stemp1 int -= stempi1 int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players operation stemp2 int -= stempi2 int + +execute positioned 0.0 0.0 0.0 facing entity @s feet run tp @s ^ ^ ^1.0 +execute store result score stemp0 int run data get entity @s Pos[0] 10000 +execute store result score stemp1 int run data get entity @s Pos[1] 10000 +execute store result score stemp2 int run data get entity @s Pos[2] 10000 + +scoreboard players operation stemp6 int = 3vec_l int +scoreboard players operation stemp7 int = 3vec_l int +scoreboard players operation stemp6 int /= 10000 int +scoreboard players operation stemp7 int %= 10000 int + +scoreboard players operation stemp8 int = stemp0 int +scoreboard players operation stemp0 int *= stemp6 int +scoreboard players operation stemp8 int *= stemp7 int +scoreboard players operation stemp8 int /= 10000 int +scoreboard players operation stemp0 int += stemp8 int +scoreboard players operation stemp0 int /= 3vec_n int + +scoreboard players operation stemp8 int = stemp1 int +scoreboard players operation stemp1 int *= stemp6 int +scoreboard players operation stemp8 int *= stemp7 int +scoreboard players operation stemp8 int /= 10000 int +scoreboard players operation stemp1 int += stemp8 int +scoreboard players operation stemp1 int /= 3vec_n int + +scoreboard players operation stemp8 int = stemp2 int +scoreboard players operation stemp2 int *= stemp6 int +scoreboard players operation stemp8 int *= stemp7 int +scoreboard players operation stemp8 int /= 10000 int +scoreboard players operation stemp2 int += stemp8 int +scoreboard players operation stemp2 int /= 3vec_n int + +scoreboard players set sloop int 0 +execute if score sloop int < stempn int run function math:3vec/dsp/loop1 + +tp @s ~ ~ ~ \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop0.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop0.mcfunction new file mode 100644 index 00000000..d7d5be90 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop0.mcfunction @@ -0,0 +1,23 @@ +execute at @s run function math:particle/_dsp + +scoreboard players operation sstemp3 int += stemp3 int +scoreboard players operation sstemp4 int += stemp4 int +scoreboard players operation sstemp5 int += stemp5 int +scoreboard players operation sstemp6 int = sstemp3 int +scoreboard players operation sstemp7 int = sstemp4 int +scoreboard players operation sstemp8 int = sstemp5 int +scoreboard players operation sstemp6 int /= 3vec_n int +scoreboard players operation sstemp7 int /= 3vec_n int +scoreboard players operation sstemp8 int /= 3vec_n int +scoreboard players operation sstemp0 int += sstemp6 int +scoreboard players operation sstemp1 int += sstemp7 int +scoreboard players operation sstemp2 int += sstemp8 int +scoreboard players operation sstemp3 int %= 3vec_n int +scoreboard players operation sstemp4 int %= 3vec_n int +scoreboard players operation sstemp5 int %= 3vec_n int + +execute store result entity @s Pos[0] double 0.0001 run scoreboard players operation sstemp0 int += stemp0 int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players operation sstemp1 int += stemp1 int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players operation sstemp2 int += stemp2 int +scoreboard players add sloop int 1 +execute if score sloop int < 3vec_n int run function math:3vec/dsp/loop0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop1.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop1.mcfunction new file mode 100644 index 00000000..e9477bbb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/dsp/loop1.mcfunction @@ -0,0 +1,7 @@ +execute at @s run function math:particle/_dsp + +execute store result entity @s Pos[0] double 0.0001 run scoreboard players operation sstemp0 int += stemp0 int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players operation sstemp1 int += stemp1 int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players operation sstemp2 int += stemp2 int +scoreboard players add sloop int 1 +execute if score sloop int < stempn int run function math:3vec/dsp/loop1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/exlen/3div.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/exlen/3div.mcfunction new file mode 100644 index 00000000..32900b5a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/exlen/3div.mcfunction @@ -0,0 +1,4 @@ +#math:3vec/exlen/3div +scoreboard players operation stempx int /= 10 int +scoreboard players operation stempy int /= 10 int +scoreboard players operation stempz int /= 10 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/exlen/range0.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/exlen/range0.mcfunction new file mode 100644 index 00000000..d815800b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/exlen/range0.mcfunction @@ -0,0 +1,3 @@ +scoreboard players remove 3vec_l int 1 +scoreboard players operation 3vec_l int /= 119 int +scoreboard players add 3vec_l int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/exlen/range1.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/exlen/range1.mcfunction new file mode 100644 index 00000000..ad5234ac --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/exlen/range1.mcfunction @@ -0,0 +1,3 @@ +scoreboard players remove 3vec_l int 13924 +scoreboard players operation 3vec_l int /= 4214 int +scoreboard players add 3vec_l int 118 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/exlen/range2.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/exlen/range2.mcfunction new file mode 100644 index 00000000..10754818 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/exlen/range2.mcfunction @@ -0,0 +1,3 @@ +scoreboard players remove 3vec_l int 16777216 +scoreboard players operation 3vec_l int /= 50436 int +scoreboard players add 3vec_l int 4096 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/3vec/init.mcfunction b/mcfpp/math/src/math/data/math/functions/3vec/init.mcfunction new file mode 100644 index 00000000..992f2366 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/3vec/init.mcfunction @@ -0,0 +1,7 @@ +#math:3vec/init +scoreboard objectives add 3vec_x dummy +scoreboard objectives add 3vec_y dummy +scoreboard objectives add 3vec_z dummy +scoreboard objectives add 3vec_rot0 dummy +scoreboard objectives add 3vec_rot1 dummy +scoreboard objectives add 3vec_l dummy \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_init.mcfunction b/mcfpp/math/src/math/data/math/functions/_init.mcfunction new file mode 100644 index 00000000..3eeeb163 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_init.mcfunction @@ -0,0 +1,87 @@ +#math:_init +# 初始化数学库 +# 使用数学库之前必须手动执行 + +#主世界设置 +execute in minecraft:the_overworld run function math:init_overworld + +#全局记分板 +scoreboard objectives add id dummy +scoreboard objectives add int dummy + +#常量设置 +scoreboard players set -10000 int -10000 +scoreboard players set -1000 int -1000 +scoreboard players set -2 int -2 +scoreboard players set -1 int -1 +scoreboard players set 0 int 0 +scoreboard players set 1 int 1 +scoreboard players set 2 int 2 +scoreboard players set 3 int 3 +scoreboard players set 4 int 4 +scoreboard players set 5 int 5 +scoreboard players set 6 int 6 +scoreboard players set 7 int 7 +scoreboard players set 8 int 8 +scoreboard players set 9 int 9 +scoreboard players set 10 int 10 +scoreboard players set 16 int 16 +scoreboard players set 25 int 25 +scoreboard players set 40 int 40 +scoreboard players set 50 int 50 +scoreboard players set 100 int 100 +scoreboard players set 119 int 119 +scoreboard players set 500 int 500 +scoreboard players set 1000 int 1000 +scoreboard players set 1745 int 1745 +scoreboard players set 2550 int 2550 +scoreboard players set 4214 int 4214 +scoreboard players set 5000 int 5000 +scoreboard players set 5100 int 5100 +scoreboard players set 5202 int 5202 +scoreboard players set 10000 int 10000 +scoreboard players set 12500 int 12500 +scoreboard players set 50000 int 50000 +scoreboard players set 50436 int 50436 +scoreboard players set 100000 int 100000 +scoreboard players set 1000000 int 1000000 +scoreboard players set 3600000 int 3600000 +scoreboard players set 10000000 int 10000000 +scoreboard players set 100000000 int 100000000 +scoreboard players set 1000000000 int 1000000000 +scoreboard players set 1103515245 int 1103515245 + +#高频循环 +schedule function math:tick 1t replace + +#数据模板 +data modify storage math:class cmp_rules set value {"ab":1b,"a<=b":0b,"a>=b":1b} +data modify storage math:class chars set value ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] +data modify storage math:class items set value [{id:"minecraft:red_wool",Count:1b,name:"r"},{id:"minecraft:green_wool",Count:1b,name:"g"},{id:"minecraft:blue_wool",Count:1b,name:"b"}] + +#临时对象初始化 +data modify storage math:io item set value {} + +data modify storage math:io classify set value [] +scoreboard players set classify_cnt int 0 + +data modify storage math:io rand_lst set value [8593,45316,3528,4112,43,296358,12936510] +execute store result score rand_seed int run data get storage math:io rand_lst[0] + +scoreboard players set particle int 4 +scoreboard players set 3vec_n int 200 + +#递归函数栈 +data modify storage math:io rec set value [{}] + +#三维向量初始化 +function math:3vec/init + +#高精度模块初始化 +function math:hpo/init + +#集合初始化 +function math:set/init + +#标记已经初始化 +scoreboard players set math mcfpp_init 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_posto.mcfunction b/mcfpp/math/src/math/data/math/functions/_posto.mcfunction new file mode 100644 index 00000000..951dc7a9 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_posto.mcfunction @@ -0,0 +1,7 @@ +#math:_posto +# 坐标转换函数 +# 输入执行者坐标 +# 输出{,,} +execute store result score x int run data get entity @s Pos[0] 10000 +execute store result score y int run data get entity @s Pos[1] 10000 +execute store result score z int run data get entity @s Pos[2] 10000 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_random.mcfunction b/mcfpp/math/src/math/data/math/functions/_random.mcfunction new file mode 100644 index 00000000..94e9f9e7 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_random.mcfunction @@ -0,0 +1,12 @@ +#math:_random +# 进行一次随机数迭代 +# 输入随机数范围{,} +# 输出 +scoreboard players operation sstemp int = max int +scoreboard players operation sstemp int -= min int +scoreboard players add sstemp int 1 +scoreboard players operation rand_seed int *= 1103515245 int +scoreboard players add rand_seed int 12345 +scoreboard players operation random int = rand_seed int +scoreboard players operation random int %= sstemp int +scoreboard players operation random int += min int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_refacing.mcfunction b/mcfpp/math/src/math/data/math/functions/_refacing.mcfunction new file mode 100644 index 00000000..1b6f097c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_refacing.mcfunction @@ -0,0 +1,12 @@ +#math:_refacing +# 规整化执行者的朝向 +# execute rotated 44.9 45.1 as entity run function math:_refacing +# 朝向被规整化为(0.0,90.0) + +execute as 0-0-0-8593-0 run function math:3vec/_facingto +function math:3vec/_polar +execute if score 3vec_x int = 3vec_z int run scoreboard players set 3vec_x int 0 +execute if score 3vec_x int = 3vec_y int run scoreboard players set 3vec_x int 0 +execute if score 3vec_y int = 3vec_z int run scoreboard players set 3vec_y int 0 +execute as 0-0-0-8593-0 run function math:3vec/_tofacing +execute at @s rotated as 0-0-0-8593-0 run tp @s ~ ~ ~ ~ ~ \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_sincos.mcfunction b/mcfpp/math/src/math/data/math/functions/_sincos.mcfunction new file mode 100644 index 00000000..f301b0fd --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_sincos.mcfunction @@ -0,0 +1,9 @@ +#math:_sincos +# 计算正余弦 +# 需要传入世界实体为执行者 +# 输入 +# 输出{,} +execute store result entity @s Rotation[0] float -0.0001 run scoreboard players get inp int +execute at @s positioned 0.0 0.0 0.0 rotated ~ 0.0 run tp @s ^ ^ ^1.0 +execute store result score cos int run data get entity @s Pos[2] 10000 +execute store result score sin int run data get entity @s Pos[0] 10000 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_sqrt.mcfunction b/mcfpp/math/src/math/data/math/functions/_sqrt.mcfunction new file mode 100644 index 00000000..473435ea --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_sqrt.mcfunction @@ -0,0 +1,20 @@ +#math:_sqrt +# 计算整数精度开根号 +# 输入 +# 输出 +execute store result score stemp0 int store result score stemp1 int store result score stemp2 int store result score stemp3 int run scoreboard players operation res int = inp int +execute if score inp int matches ..13924 run function math:sqrt/range0 +execute if score inp int matches 13925..16777216 run function math:sqrt/range1 +execute if score inp int matches 16777217.. run function math:sqrt/range2 +scoreboard players operation stemp0 int /= res int +scoreboard players operation res int += stemp0 int +scoreboard players operation res int /= 2 int +scoreboard players operation stemp1 int /= res int +scoreboard players operation res int += stemp1 int +scoreboard players operation res int /= 2 int +scoreboard players operation stemp2 int /= res int +scoreboard players operation res int += stemp2 int +scoreboard players operation res int /= 2 int +scoreboard players operation stemp3 int /= res int +scoreboard players operation res int += stemp3 int +scoreboard players operation res int /= 2 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_topos.mcfunction b/mcfpp/math/src/math/data/math/functions/_topos.mcfunction new file mode 100644 index 00000000..1782e186 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_topos.mcfunction @@ -0,0 +1,7 @@ +#math:_topos +# 坐标转换函数 +# 输入{,,} +# 输出执行者坐标 +execute store result entity @s Pos[0] double 0.0001 run scoreboard players get x int +execute store result entity @s Pos[1] double 0.0001 run scoreboard players get y int +execute store result entity @s Pos[2] double 0.0001 run scoreboard players get z int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_version.mcfunction b/mcfpp/math/src/math/data/math/functions/_version.mcfunction new file mode 100644 index 00000000..b5faab17 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_version.mcfunction @@ -0,0 +1,4 @@ +#math:_version +# 输出数学库版本 +tellraw @s {"text":"<数学库> 当前为2.0.3版本."} +scoreboard players set version int 203 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/_xyz.mcfunction b/mcfpp/math/src/math/data/math/functions/_xyz.mcfunction new file mode 100644 index 00000000..d3d3f7d9 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/_xyz.mcfunction @@ -0,0 +1,9 @@ +#math:_xyz +# 坐标转换函数 +# 需要传入世界实体为执行者 +# 输入执行坐标 +# 输出{,,} +tp @s ~ ~ ~ +execute store result score x int run data get entity @s Pos[0] 10000 +execute store result score y int run data get entity @s Pos[1] 10000 +execute store result score z int run data get entity @s Pos[2] 10000 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/classify/_append.mcfunction b/mcfpp/math/src/math/data/math/functions/classify/_append.mcfunction new file mode 100644 index 00000000..f05788eb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/classify/_append.mcfunction @@ -0,0 +1,8 @@ +#math:classify/_append +scoreboard players set sstemp int 1 +#进入转盘 +scoreboard players operation ssloop int = classify_cnt int +execute if score ssloop int matches 1.. run function math:classify/sloop +#添加进分类 +execute if score sstemp int matches 1 run function math:classify/new_group +data modify storage math:io classify[-1] append from storage math:io input \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/classify/_ssnew.mcfunction b/mcfpp/math/src/math/data/math/functions/classify/_ssnew.mcfunction new file mode 100644 index 00000000..732e9842 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/classify/_ssnew.mcfunction @@ -0,0 +1,3 @@ +#math:classify/_ssnew +data modify storage math:io classify set value [] +scoreboard players set classify_cnt int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/classify/new_group.mcfunction b/mcfpp/math/src/math/data/math/functions/classify/new_group.mcfunction new file mode 100644 index 00000000..4d272d04 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/classify/new_group.mcfunction @@ -0,0 +1,3 @@ +#math:classify/new_group +data modify storage math:io classify append value [] +scoreboard players add classify_cnt int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/classify/sloop.mcfunction b/mcfpp/math/src/math/data/math/functions/classify/sloop.mcfunction new file mode 100644 index 00000000..44b7ae7c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/classify/sloop.mcfunction @@ -0,0 +1,10 @@ +#math:classify/sloop +#比较元素,如果相同,转盘停止 +data modify storage math:io stemp_cmp set from storage math:io classify[0][0].key +execute store success score sstemp int run data modify storage math:io stemp_cmp set from storage math:io input.key +execute if score sstemp int matches 0 run scoreboard players set ssloop int 1 +#循环 +data modify storage math:io classify append from storage math:io classify[0] +data remove storage math:io classify[0] +scoreboard players remove ssloop int 1 +execute if score ssloop int matches 1.. run function math:classify/sloop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3div_resign.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3div_resign.mcfunction new file mode 100644 index 00000000..19fb798a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3div_resign.mcfunction @@ -0,0 +1,3 @@ +#math:hpo/3div_resign +scoreboard players operation res int *= -1 int +scoreboard players operation inp int *= -1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_add.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_add.mcfunction new file mode 100644 index 00000000..6d485df8 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_add.mcfunction @@ -0,0 +1,96 @@ +#math:hpo/3vec_float/_add + +function math:hpo/3vec_float/_ssprintx +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s 3vec_float_x_sign +scoreboard players operation sstemp_sign int *= 3vec_float_x_sign int +scoreboard players set sstempr int 1 +scoreboard players operation 3vec_float_x_int0 int *= 10000 int +scoreboard players operation 3vec_float_x_int0 int += 3vec_float_x_int1 int +scoreboard players operation sstemp1 int = @s 3vec_float_x_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s 3vec_float_x_int1 +execute if score 3vec_float_x_exp int > @s 3vec_float_x_exp run scoreboard players set sstempr int 0 +execute if score 3vec_float_x_exp int = @s 3vec_float_x_exp if score 3vec_float_x_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = 3vec_float_x_exp int +scoreboard players operation sstempe int -= @s 3vec_float_x_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/3vec_float/add_swapx +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation 3vec_float_x_int0 int += sstemp1 int +#对齐小数点 +execute if score 3vec_float_x_int0 int matches 100000.. run function math:hpo/3vec_float/addx_search/align_s2 +execute if score 3vec_float_x_int0 int matches 100..99999 run function math:hpo/3vec_float/addx_search/align_s1 +execute if score 3vec_float_x_int0 int matches 0..99 run function math:hpo/3vec_float/addx_search/align_s0 +scoreboard players operation 3vec_float_x_int1 int = 3vec_float_x_int0 int +scoreboard players operation 3vec_float_x_int0 int /= 10000 int +scoreboard players operation 3vec_float_x_int1 int %= 10000 int +function math:hpo/3vec_float/_ssprintx + +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s 3vec_float_y_sign +scoreboard players operation sstemp_sign int *= 3vec_float_y_sign int +scoreboard players set sstempr int 1 +scoreboard players operation 3vec_float_y_int0 int *= 10000 int +scoreboard players operation 3vec_float_y_int0 int += 3vec_float_y_int1 int +scoreboard players operation sstemp1 int = @s 3vec_float_y_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s 3vec_float_y_int1 +execute if score 3vec_float_y_exp int > @s 3vec_float_y_exp run scoreboard players set sstempr int 0 +execute if score 3vec_float_y_exp int = @s 3vec_float_y_exp if score 3vec_float_y_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = 3vec_float_y_exp int +scoreboard players operation sstempe int -= @s 3vec_float_y_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/3vec_float/add_swapy +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation 3vec_float_y_int0 int += sstemp1 int +#对齐小数点 +execute if score 3vec_float_y_int0 int matches 100000.. run function math:hpo/3vec_float/addy_search/align_s2 +execute if score 3vec_float_y_int0 int matches 100..99999 run function math:hpo/3vec_float/addy_search/align_s1 +execute if score 3vec_float_y_int0 int matches 0..99 run function math:hpo/3vec_float/addy_search/align_s0 +scoreboard players operation 3vec_float_y_int1 int = 3vec_float_y_int0 int +scoreboard players operation 3vec_float_y_int0 int /= 10000 int +scoreboard players operation 3vec_float_y_int1 int %= 10000 int + +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s 3vec_float_z_sign +scoreboard players operation sstemp_sign int *= 3vec_float_z_sign int +scoreboard players set sstempr int 1 +scoreboard players operation 3vec_float_z_int0 int *= 10000 int +scoreboard players operation 3vec_float_z_int0 int += 3vec_float_z_int1 int +scoreboard players operation sstemp1 int = @s 3vec_float_z_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s 3vec_float_z_int1 +execute if score 3vec_float_z_exp int > @s 3vec_float_z_exp run scoreboard players set sstempr int 0 +execute if score 3vec_float_z_exp int = @s 3vec_float_z_exp if score 3vec_float_z_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = 3vec_float_z_exp int +scoreboard players operation sstempe int -= @s 3vec_float_z_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/3vec_float/add_swapz +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation 3vec_float_z_int0 int += sstemp1 int +#对齐小数点 +execute if score 3vec_float_z_int0 int matches 100000.. run function math:hpo/3vec_float/addz_search/align_s2 +execute if score 3vec_float_z_int0 int matches 100..99999 run function math:hpo/3vec_float/addz_search/align_s1 +execute if score 3vec_float_z_int0 int matches 0..99 run function math:hpo/3vec_float/addz_search/align_s0 +scoreboard players operation 3vec_float_z_int1 int = 3vec_float_z_int0 int +scoreboard players operation 3vec_float_z_int0 int /= 10000 int +scoreboard players operation 3vec_float_z_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_cross.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_cross.mcfunction new file mode 100644 index 00000000..da1a4b98 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_cross.mcfunction @@ -0,0 +1,107 @@ +#math:hpo/3vec_float/_cross +#计算叉乘 +scoreboard players operation float_sign int = @s 3vec_float_x_sign +scoreboard players operation float_int0 int = @s 3vec_float_x_int0 +scoreboard players operation float_int1 int = @s 3vec_float_x_int1 +scoreboard players operation float_exp int = @s 3vec_float_x_exp +scoreboard players operation @s float_sign = 3vec_float_y_sign int +scoreboard players operation @s float_int0 = 3vec_float_y_int0 int +scoreboard players operation @s float_int1 = 3vec_float_y_int1 int +scoreboard players operation @s float_exp = 3vec_float_y_exp int +function math:hpo/float/_mult +scoreboard players operation ssstemp0_sign int = float_sign int +scoreboard players operation ssstemp0_int0 int = float_int0 int +scoreboard players operation ssstemp0_int1 int = float_int1 int +scoreboard players operation ssstemp0_exp int = float_exp int +scoreboard players operation float_sign int = @s 3vec_float_y_sign +scoreboard players operation float_int0 int = @s 3vec_float_y_int0 +scoreboard players operation float_int1 int = @s 3vec_float_y_int1 +scoreboard players operation float_exp int = @s 3vec_float_y_exp +scoreboard players operation @s float_sign = 3vec_float_x_sign int +scoreboard players operation @s float_int0 = 3vec_float_x_int0 int +scoreboard players operation @s float_int1 = 3vec_float_x_int1 int +scoreboard players operation @s float_exp = 3vec_float_x_exp int +function math:hpo/float/_mult +scoreboard players operation @s float_sign = ssstemp0_sign int +scoreboard players operation @s float_int0 = ssstemp0_int0 int +scoreboard players operation @s float_int1 = ssstemp0_int1 int +scoreboard players operation @s float_exp = ssstemp0_exp int +function math:hpo/float/_rmv +scoreboard players operation ssstemp1_sign int = float_sign int +scoreboard players operation ssstemp1_int0 int = float_int0 int +scoreboard players operation ssstemp1_int1 int = float_int1 int +scoreboard players operation ssstemp1_exp int = float_exp int + +scoreboard players operation float_sign int = @s 3vec_float_z_sign +scoreboard players operation float_int0 int = @s 3vec_float_z_int0 +scoreboard players operation float_int1 int = @s 3vec_float_z_int1 +scoreboard players operation float_exp int = @s 3vec_float_z_exp +scoreboard players operation @s float_sign = 3vec_float_x_sign int +scoreboard players operation @s float_int0 = 3vec_float_x_int0 int +scoreboard players operation @s float_int1 = 3vec_float_x_int1 int +scoreboard players operation @s float_exp = 3vec_float_x_exp int +function math:hpo/float/_mult +scoreboard players operation ssstemp0_sign int = float_sign int +scoreboard players operation ssstemp0_int0 int = float_int0 int +scoreboard players operation ssstemp0_int1 int = float_int1 int +scoreboard players operation ssstemp0_exp int = float_exp int +scoreboard players operation float_sign int = @s 3vec_float_x_sign +scoreboard players operation float_int0 int = @s 3vec_float_x_int0 +scoreboard players operation float_int1 int = @s 3vec_float_x_int1 +scoreboard players operation float_exp int = @s 3vec_float_x_exp +scoreboard players operation @s float_sign = 3vec_float_z_sign int +scoreboard players operation @s float_int0 = 3vec_float_z_int0 int +scoreboard players operation @s float_int1 = 3vec_float_z_int1 int +scoreboard players operation @s float_exp = 3vec_float_z_exp int +function math:hpo/float/_mult +scoreboard players operation @s float_sign = ssstemp0_sign int +scoreboard players operation @s float_int0 = ssstemp0_int0 int +scoreboard players operation @s float_int1 = ssstemp0_int1 int +scoreboard players operation @s float_exp = ssstemp0_exp int +function math:hpo/float/_rmv +scoreboard players operation ssstemp2_sign int = float_sign int +scoreboard players operation ssstemp2_int0 int = float_int0 int +scoreboard players operation ssstemp2_int1 int = float_int1 int +scoreboard players operation ssstemp2_exp int = float_exp int + +scoreboard players operation float_sign int = @s 3vec_float_y_sign +scoreboard players operation float_int0 int = @s 3vec_float_y_int0 +scoreboard players operation float_int1 int = @s 3vec_float_y_int1 +scoreboard players operation float_exp int = @s 3vec_float_y_exp +scoreboard players operation @s float_sign = 3vec_float_z_sign int +scoreboard players operation @s float_int0 = 3vec_float_z_int0 int +scoreboard players operation @s float_int1 = 3vec_float_z_int1 int +scoreboard players operation @s float_exp = 3vec_float_z_exp int +function math:hpo/float/_mult +scoreboard players operation ssstemp0_sign int = float_sign int +scoreboard players operation ssstemp0_int0 int = float_int0 int +scoreboard players operation ssstemp0_int1 int = float_int1 int +scoreboard players operation ssstemp0_exp int = float_exp int +scoreboard players operation float_sign int = @s 3vec_float_z_sign +scoreboard players operation float_int0 int = @s 3vec_float_z_int0 +scoreboard players operation float_int1 int = @s 3vec_float_z_int1 +scoreboard players operation float_exp int = @s 3vec_float_z_exp +scoreboard players operation @s float_sign = 3vec_float_y_sign int +scoreboard players operation @s float_int0 = 3vec_float_y_int0 int +scoreboard players operation @s float_int1 = 3vec_float_y_int1 int +scoreboard players operation @s float_exp = 3vec_float_y_exp int +function math:hpo/float/_mult +scoreboard players operation @s float_sign = ssstemp0_sign int +scoreboard players operation @s float_int0 = ssstemp0_int0 int +scoreboard players operation @s float_int1 = ssstemp0_int1 int +scoreboard players operation @s float_exp = ssstemp0_exp int +function math:hpo/float/_rmv +scoreboard players operation 3vec_float_x_sign int = float_sign int +scoreboard players operation 3vec_float_x_int0 int = float_int0 int +scoreboard players operation 3vec_float_x_int1 int = float_int1 int +scoreboard players operation 3vec_float_x_exp int = float_exp int + +scoreboard players operation 3vec_float_y_sign int = ssstemp2_sign int +scoreboard players operation 3vec_float_y_int0 int = ssstemp2_int0 int +scoreboard players operation 3vec_float_y_int1 int = ssstemp2_int1 int +scoreboard players operation 3vec_float_y_exp int = ssstemp2_exp int + +scoreboard players operation 3vec_float_z_sign int = ssstemp1_sign int +scoreboard players operation 3vec_float_z_int0 int = ssstemp1_int0 int +scoreboard players operation 3vec_float_z_int1 int = ssstemp1_int1 int +scoreboard players operation 3vec_float_z_exp int = ssstemp1_exp int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_div.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_div.mcfunction new file mode 100644 index 00000000..83bfbf70 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_div.mcfunction @@ -0,0 +1,114 @@ +#math:hpo/3vec_float/_div + +#由万进制节计算除数和被除数 +scoreboard players operation sstempd int = @s float_int0 +scoreboard players operation sstempd int *= 10000 int +scoreboard players operation sstempd int += @s float_int1 +scoreboard players set float_int0 int 100000000 + +#计算结果前后4位精度 +scoreboard players operation sstemp0 int = sstempd int +scoreboard players operation sstempd int /= 25 int +scoreboard players operation sstemp0 int %= 25 int +scoreboard players operation sstemp1 int = float_int0 int +scoreboard players operation float_int0 int /= sstempd int +scoreboard players operation float_int0 int *= 40 int +scoreboard players operation sstemp1 int %= sstempd int +scoreboard players operation sstemp1 int *= 40 int +scoreboard players operation float_int1 int = sstemp1 int +scoreboard players operation sstemp1 int /= sstempd int +scoreboard players operation float_int0 int += sstemp1 int +scoreboard players operation float_int1 int %= sstempd int +scoreboard players operation float_int1 int *= 25 int +scoreboard players operation sstemp2 int = sstemp0 int +scoreboard players operation sstemp2 int *= float_int0 int +scoreboard players operation float_int1 int -= sstemp2 int +scoreboard players operation float_int1 int *= 10 int +scoreboard players operation sstemp1 int = float_int1 int +scoreboard players operation float_int1 int /= sstempd int +scoreboard players operation float_int1 int *= 40 int +scoreboard players operation sstemp1 int %= sstempd int +scoreboard players operation sstemp1 int *= 40 int +scoreboard players operation sstemp1 int /= sstempd int +scoreboard players operation float_int1 int += sstemp1 int +#符号 +scoreboard players operation float_sign int = @s float_sign +#指数 +scoreboard players operation float_exp int = @s float_exp +scoreboard players operation float_exp int *= -1 int +scoreboard players add float_exp int 1 +#对齐小数点 +execute if score float_int0 int matches 10000.. run function math:hpo/float/div_align + +#--------- +#高低位 +scoreboard players operation sstemp0 int = 3vec_float_x_int0 int +scoreboard players operation sstemp0 int *= float_int1 int +scoreboard players operation sstemp1 int = 3vec_float_x_int1 int +scoreboard players operation sstemp1 int *= float_int1 int +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation 3vec_float_x_int1 int *= float_int0 int +scoreboard players operation 3vec_float_x_int1 int += sstemp0 int +scoreboard players operation 3vec_float_x_int1 int += sstemp1 int +scoreboard players operation 3vec_float_x_int0 int *= float_int0 int +scoreboard players operation 3vec_float_x_int0 int *= 10 int +scoreboard players operation 3vec_float_x_int1 int /= 1000 int +scoreboard players operation 3vec_float_x_int0 int += 3vec_float_x_int1 int +#符号位 +scoreboard players operation 3vec_float_x_sign int *= float_sign int +#指数位 +scoreboard players operation 3vec_float_x_exp int += float_exp int +scoreboard players remove 3vec_float_x_exp int 1 +#小数位对齐 +execute if score 3vec_float_x_int0 int matches 100000000.. run function math:hpo/3vec_float/mult_alignx +scoreboard players operation 3vec_float_x_int1 int = 3vec_float_x_int0 int +scoreboard players operation 3vec_float_x_int0 int /= 10000 int +scoreboard players operation 3vec_float_x_int1 int %= 10000 int + +#高低位 +scoreboard players operation sstemp0 int = 3vec_float_y_int0 int +scoreboard players operation sstemp0 int *= float_int1 int +scoreboard players operation sstemp1 int = 3vec_float_y_int1 int +scoreboard players operation sstemp1 int *= float_int1 int +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation 3vec_float_y_int1 int *= float_int0 int +scoreboard players operation 3vec_float_y_int1 int += sstemp0 int +scoreboard players operation 3vec_float_y_int1 int += sstemp1 int +scoreboard players operation 3vec_float_y_int0 int *= float_int0 int +scoreboard players operation 3vec_float_y_int0 int *= 10 int +scoreboard players operation 3vec_float_y_int1 int /= 1000 int +scoreboard players operation 3vec_float_y_int0 int += 3vec_float_y_int1 int +#符号位 +scoreboard players operation 3vec_float_y_sign int *= float_sign int +#指数位 +scoreboard players operation 3vec_float_y_exp int += float_exp int +scoreboard players remove 3vec_float_y_exp int 1 +#小数位对齐 +execute if score 3vec_float_y_int0 int matches 100000000.. run function math:hpo/3vec_float/mult_aligny +scoreboard players operation 3vec_float_y_int1 int = 3vec_float_y_int0 int +scoreboard players operation 3vec_float_y_int0 int /= 10000 int +scoreboard players operation 3vec_float_y_int1 int %= 10000 int + +#高低位 +scoreboard players operation sstemp0 int = 3vec_float_z_int0 int +scoreboard players operation sstemp0 int *= float_int1 int +scoreboard players operation sstemp1 int = 3vec_float_z_int1 int +scoreboard players operation sstemp1 int *= float_int1 int +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation 3vec_float_z_int1 int *= float_int0 int +scoreboard players operation 3vec_float_z_int1 int += sstemp0 int +scoreboard players operation 3vec_float_z_int1 int += sstemp1 int +scoreboard players operation 3vec_float_z_int0 int *= float_int0 int +scoreboard players operation 3vec_float_z_int0 int *= 10 int +scoreboard players operation 3vec_float_z_int1 int /= 1000 int +scoreboard players operation 3vec_float_z_int0 int += 3vec_float_z_int1 int +#符号位 +scoreboard players operation 3vec_float_z_sign int *= float_sign int +#指数位 +scoreboard players operation 3vec_float_z_exp int += float_exp int +scoreboard players remove 3vec_float_z_exp int 1 +#小数位对齐 +execute if score 3vec_float_z_int0 int matches 100000000.. run function math:hpo/3vec_float/mult_alignz +scoreboard players operation 3vec_float_z_int1 int = 3vec_float_z_int0 int +scoreboard players operation 3vec_float_z_int0 int /= 10000 int +scoreboard players operation 3vec_float_z_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_dot.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_dot.mcfunction new file mode 100644 index 00000000..3e7e55bd --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_dot.mcfunction @@ -0,0 +1,160 @@ +#math:hpo/3vec_float/_dot +#计算点乘 +#低位 +scoreboard players operation sstemp0 int = 3vec_float_x_int0 int +scoreboard players operation sstemp0 int *= @s 3vec_float_x_int1 +scoreboard players operation sstemp1 int = 3vec_float_x_int1 int +scoreboard players operation sstemp1 int *= @s 3vec_float_x_int1 +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation float_int1 int = 3vec_float_x_int1 int +scoreboard players operation float_int1 int *= @s 3vec_float_x_int0 +scoreboard players operation float_int1 int += sstemp0 int +scoreboard players operation float_int1 int += sstemp1 int +#高位 +scoreboard players operation float_int0 int = 3vec_float_x_int0 int +scoreboard players operation float_int0 int *= @s 3vec_float_x_int0 +scoreboard players operation float_int0 int *= 10 int +scoreboard players operation float_int1 int /= 1000 int +scoreboard players operation float_int0 int += float_int1 int +#符号位 +scoreboard players operation float_sign int = 3vec_float_x_sign int +scoreboard players operation float_sign int *= @s 3vec_float_x_sign +#指数位 +scoreboard players operation float_exp int = 3vec_float_x_exp int +scoreboard players operation float_exp int += @s 3vec_float_x_exp +scoreboard players remove float_exp int 1 +#小数位对齐 +execute if score float_int0 int matches 100000000.. run function math:hpo/float/mult_align +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int + +scoreboard players operation @s float_sign = float_sign int +scoreboard players operation @s float_int0 = float_int0 int +scoreboard players operation @s float_int1 = float_int1 int +scoreboard players operation @s float_exp = float_exp int + +#低位 +scoreboard players operation sstemp0 int = 3vec_float_y_int0 int +scoreboard players operation sstemp0 int *= @s 3vec_float_y_int1 +scoreboard players operation sstemp1 int = 3vec_float_y_int1 int +scoreboard players operation sstemp1 int *= @s 3vec_float_y_int1 +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation float_int1 int = 3vec_float_y_int1 int +scoreboard players operation float_int1 int *= @s 3vec_float_y_int0 +scoreboard players operation float_int1 int += sstemp0 int +scoreboard players operation float_int1 int += sstemp1 int +#高位 +scoreboard players operation float_int0 int = 3vec_float_y_int0 int +scoreboard players operation float_int0 int *= @s 3vec_float_y_int0 +scoreboard players operation float_int0 int *= 10 int +scoreboard players operation float_int1 int /= 1000 int +scoreboard players operation float_int0 int += float_int1 int +#符号位 +scoreboard players operation float_sign int = 3vec_float_y_sign int +scoreboard players operation float_sign int *= @s 3vec_float_y_sign +#指数位 +scoreboard players operation float_exp int = 3vec_float_y_exp int +scoreboard players operation float_exp int += @s 3vec_float_y_exp +scoreboard players remove float_exp int 1 +#小数位对齐 +execute if score float_int0 int matches 100000000.. run function math:hpo/float/mult_align +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int + +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s float_sign +scoreboard players operation sstemp_sign int *= float_sign int +scoreboard players set sstempr int 1 +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int +scoreboard players operation sstemp1 int = @s float_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s float_int1 +execute if score float_exp int > @s float_exp run scoreboard players set sstempr int 0 +execute if score float_exp int = @s float_exp if score float_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = float_exp int +scoreboard players operation sstempe int -= @s float_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/float/add_swap +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation float_int0 int += sstemp1 int +#对齐小数点 +execute if score float_int0 int matches 100000.. run function math:hpo/float/add_search/align_s2 +execute if score float_int0 int matches 100..99999 run function math:hpo/float/add_search/align_s1 +execute if score float_int0 int matches 0..99 run function math:hpo/float/add_search/align_s0 +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int + +scoreboard players operation @s float_sign = float_sign int +scoreboard players operation @s float_int0 = float_int0 int +scoreboard players operation @s float_int1 = float_int1 int +scoreboard players operation @s float_exp = float_exp int + +#低位 +scoreboard players operation sstemp0 int = 3vec_float_z_int0 int +scoreboard players operation sstemp0 int *= @s 3vec_float_z_int1 +scoreboard players operation sstemp1 int = 3vec_float_z_int1 int +scoreboard players operation sstemp1 int *= @s 3vec_float_z_int1 +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation float_int1 int = 3vec_float_z_int1 int +scoreboard players operation float_int1 int *= @s 3vec_float_z_int0 +scoreboard players operation float_int1 int += sstemp0 int +scoreboard players operation float_int1 int += sstemp1 int +#高位 +scoreboard players operation float_int0 int = 3vec_float_z_int0 int +scoreboard players operation float_int0 int *= @s 3vec_float_z_int0 +scoreboard players operation float_int0 int *= 10 int +scoreboard players operation float_int1 int /= 1000 int +scoreboard players operation float_int0 int += float_int1 int +#符号位 +scoreboard players operation float_sign int = 3vec_float_z_sign int +scoreboard players operation float_sign int *= @s 3vec_float_z_sign +#指数位 +scoreboard players operation float_exp int = 3vec_float_z_exp int +scoreboard players operation float_exp int += @s 3vec_float_z_exp +scoreboard players remove float_exp int 1 +#小数位对齐 +execute if score float_int0 int matches 100000000.. run function math:hpo/float/mult_align +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int + +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s float_sign +scoreboard players operation sstemp_sign int *= float_sign int +scoreboard players set sstempr int 1 +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int +scoreboard players operation sstemp1 int = @s float_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s float_int1 +execute if score float_exp int > @s float_exp run scoreboard players set sstempr int 0 +execute if score float_exp int = @s float_exp if score float_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = float_exp int +scoreboard players operation sstempe int -= @s float_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/float/add_swap +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation float_int0 int += sstemp1 int +#对齐小数点 +execute if score float_int0 int matches 100000.. run function math:hpo/float/add_search/align_s2 +execute if score float_int0 int matches 100..99999 run function math:hpo/float/add_search/align_s1 +execute if score float_int0 int matches 0..99 run function math:hpo/float/add_search/align_s0 +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_get.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_get.mcfunction new file mode 100644 index 00000000..10d1860b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_get.mcfunction @@ -0,0 +1,13 @@ +#math:hpo/3vec_float/_get +scoreboard players operation 3vec_float_x_sign int = @s 3vec_float_x_sign +scoreboard players operation 3vec_float_y_sign int = @s 3vec_float_y_sign +scoreboard players operation 3vec_float_z_sign int = @s 3vec_float_z_sign +scoreboard players operation 3vec_float_x_int0 int = @s 3vec_float_x_int0 +scoreboard players operation 3vec_float_y_int0 int = @s 3vec_float_y_int0 +scoreboard players operation 3vec_float_z_int0 int = @s 3vec_float_z_int0 +scoreboard players operation 3vec_float_x_int1 int = @s 3vec_float_x_int1 +scoreboard players operation 3vec_float_y_int1 int = @s 3vec_float_y_int1 +scoreboard players operation 3vec_float_z_int1 int = @s 3vec_float_z_int1 +scoreboard players operation 3vec_float_x_exp int = @s 3vec_float_x_exp +scoreboard players operation 3vec_float_y_exp int = @s 3vec_float_y_exp +scoreboard players operation 3vec_float_z_exp int = @s 3vec_float_z_exp \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_length.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_length.mcfunction new file mode 100644 index 00000000..0f99e8d2 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_length.mcfunction @@ -0,0 +1,22 @@ +#math:hpo/3vec_float/_length +#需要传入执行者 + +scoreboard players operation float_sign int = 3vec_float_x_sign int +scoreboard players operation float_int0 int = 3vec_float_x_int0 int +scoreboard players operation float_int1 int = 3vec_float_x_int1 int +scoreboard players operation float_exp int = 3vec_float_x_exp int +function math:hpo/float/_sqr +scoreboard players operation @s float_sign = 3vec_float_y_sign int +scoreboard players operation @s float_int0 = 3vec_float_y_int0 int +scoreboard players operation @s float_int1 = 3vec_float_y_int1 int +scoreboard players operation @s float_exp = 3vec_float_y_exp int +function math:hpo/float/_zsqr +function math:hpo/float/_add +scoreboard players operation @s float_sign = 3vec_float_z_sign int +scoreboard players operation @s float_int0 = 3vec_float_z_int0 int +scoreboard players operation @s float_int1 = 3vec_float_z_int1 int +scoreboard players operation @s float_exp = 3vec_float_z_exp int +function math:hpo/float/_zsqr +function math:hpo/float/_add + +function math:hpo/float/_sqrt \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_mult.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_mult.mcfunction new file mode 100644 index 00000000..876a4ffe --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_mult.mcfunction @@ -0,0 +1,73 @@ +#math:hpo/3vec_float/_mult + +#高低位 +scoreboard players operation sstemp0 int = 3vec_float_x_int0 int +scoreboard players operation sstemp0 int *= @s float_int1 +scoreboard players operation sstemp1 int = 3vec_float_x_int1 int +scoreboard players operation sstemp1 int *= @s float_int1 +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation 3vec_float_x_int1 int *= @s float_int0 +scoreboard players operation 3vec_float_x_int1 int += sstemp0 int +scoreboard players operation 3vec_float_x_int1 int += sstemp1 int +scoreboard players operation 3vec_float_x_int0 int *= @s float_int0 +scoreboard players operation 3vec_float_x_int0 int *= 10 int +scoreboard players operation 3vec_float_x_int1 int /= 1000 int +scoreboard players operation 3vec_float_x_int0 int += 3vec_float_x_int1 int +#符号位 +scoreboard players operation 3vec_float_x_sign int *= @s float_sign +#指数位 +scoreboard players operation 3vec_float_x_exp int += @s float_exp +scoreboard players remove 3vec_float_x_exp int 1 +#小数位对齐 +execute if score 3vec_float_x_int0 int matches 100000000.. run function math:hpo/3vec_float/mult_alignx +scoreboard players operation 3vec_float_x_int1 int = 3vec_float_x_int0 int +scoreboard players operation 3vec_float_x_int0 int /= 10000 int +scoreboard players operation 3vec_float_x_int1 int %= 10000 int + +#高低位 +scoreboard players operation sstemp0 int = 3vec_float_y_int0 int +scoreboard players operation sstemp0 int *= @s float_int1 +scoreboard players operation sstemp1 int = 3vec_float_y_int1 int +scoreboard players operation sstemp1 int *= @s float_int1 +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation 3vec_float_y_int1 int *= @s float_int0 +scoreboard players operation 3vec_float_y_int1 int += sstemp0 int +scoreboard players operation 3vec_float_y_int1 int += sstemp1 int +scoreboard players operation 3vec_float_y_int0 int *= @s float_int0 +scoreboard players operation 3vec_float_y_int0 int *= 10 int +scoreboard players operation 3vec_float_y_int1 int /= 1000 int +scoreboard players operation 3vec_float_y_int0 int += 3vec_float_y_int1 int +#符号位 +scoreboard players operation 3vec_float_y_sign int *= @s float_sign +#指数位 +scoreboard players operation 3vec_float_y_exp int += @s float_exp +scoreboard players remove 3vec_float_y_exp int 1 +#小数位对齐 +execute if score 3vec_float_y_int0 int matches 100000000.. run function math:hpo/3vec_float/mult_aligny +scoreboard players operation 3vec_float_y_int1 int = 3vec_float_y_int0 int +scoreboard players operation 3vec_float_y_int0 int /= 10000 int +scoreboard players operation 3vec_float_y_int1 int %= 10000 int + +#高低位 +scoreboard players operation sstemp0 int = 3vec_float_z_int0 int +scoreboard players operation sstemp0 int *= @s float_int1 +scoreboard players operation sstemp1 int = 3vec_float_z_int1 int +scoreboard players operation sstemp1 int *= @s float_int1 +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation 3vec_float_z_int1 int *= @s float_int0 +scoreboard players operation 3vec_float_z_int1 int += sstemp0 int +scoreboard players operation 3vec_float_z_int1 int += sstemp1 int +scoreboard players operation 3vec_float_z_int0 int *= @s float_int0 +scoreboard players operation 3vec_float_z_int0 int *= 10 int +scoreboard players operation 3vec_float_z_int1 int /= 1000 int +scoreboard players operation 3vec_float_z_int0 int += 3vec_float_z_int1 int +#符号位 +scoreboard players operation 3vec_float_z_sign int *= @s float_sign +#指数位 +scoreboard players operation 3vec_float_z_exp int += @s float_exp +scoreboard players remove 3vec_float_z_exp int 1 +#小数位对齐 +execute if score 3vec_float_z_int0 int matches 100000000.. run function math:hpo/3vec_float/mult_alignz +scoreboard players operation 3vec_float_z_int1 int = 3vec_float_z_int0 int +scoreboard players operation 3vec_float_z_int0 int /= 10000 int +scoreboard players operation 3vec_float_z_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_rmv.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_rmv.mcfunction new file mode 100644 index 00000000..eddb8a68 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_rmv.mcfunction @@ -0,0 +1,94 @@ +#math:hpo/3vec_float/_rmv + +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s 3vec_float_x_sign +scoreboard players operation sstemp_sign int *= 3vec_float_x_sign int +scoreboard players set sstempr int 1 +scoreboard players operation 3vec_float_x_int0 int *= 10000 int +scoreboard players operation 3vec_float_x_int0 int += 3vec_float_x_int1 int +scoreboard players operation sstemp1 int = @s 3vec_float_x_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s 3vec_float_x_int1 +execute if score 3vec_float_x_exp int > @s 3vec_float_x_exp run scoreboard players set sstempr int 0 +execute if score 3vec_float_x_exp int = @s 3vec_float_x_exp if score 3vec_float_x_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = 3vec_float_x_exp int +scoreboard players operation sstempe int -= @s 3vec_float_x_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/3vec_float/rmv_swapx +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation 3vec_float_x_int0 int -= sstemp1 int +#对齐小数点 +execute if score 3vec_float_x_int0 int matches 100000.. run function math:hpo/3vec_float/addx_search/align_s2 +execute if score 3vec_float_x_int0 int matches 100..99999 run function math:hpo/3vec_float/addx_search/align_s1 +execute if score 3vec_float_x_int0 int matches 0..99 run function math:hpo/3vec_float/addx_search/align_s0 +scoreboard players operation 3vec_float_x_int1 int = 3vec_float_x_int0 int +scoreboard players operation 3vec_float_x_int0 int /= 10000 int +scoreboard players operation 3vec_float_x_int1 int %= 10000 int + +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s 3vec_float_y_sign +scoreboard players operation sstemp_sign int *= 3vec_float_y_sign int +scoreboard players set sstempr int 1 +scoreboard players operation 3vec_float_y_int0 int *= 10000 int +scoreboard players operation 3vec_float_y_int0 int += 3vec_float_y_int1 int +scoreboard players operation sstemp1 int = @s 3vec_float_y_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s 3vec_float_y_int1 +execute if score 3vec_float_y_exp int > @s 3vec_float_y_exp run scoreboard players set sstempr int 0 +execute if score 3vec_float_y_exp int = @s 3vec_float_y_exp if score 3vec_float_y_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = 3vec_float_y_exp int +scoreboard players operation sstempe int -= @s 3vec_float_y_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/3vec_float/rmv_swapy +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation 3vec_float_y_int0 int -= sstemp1 int +#对齐小数点 +execute if score 3vec_float_y_int0 int matches 100000.. run function math:hpo/3vec_float/addy_search/align_s2 +execute if score 3vec_float_y_int0 int matches 100..99999 run function math:hpo/3vec_float/addy_search/align_s1 +execute if score 3vec_float_y_int0 int matches 0..99 run function math:hpo/3vec_float/addy_search/align_s0 +scoreboard players operation 3vec_float_y_int1 int = 3vec_float_y_int0 int +scoreboard players operation 3vec_float_y_int0 int /= 10000 int +scoreboard players operation 3vec_float_y_int1 int %= 10000 int + +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s 3vec_float_z_sign +scoreboard players operation sstemp_sign int *= 3vec_float_z_sign int +scoreboard players set sstempr int 1 +scoreboard players operation 3vec_float_z_int0 int *= 10000 int +scoreboard players operation 3vec_float_z_int0 int += 3vec_float_z_int1 int +scoreboard players operation sstemp1 int = @s 3vec_float_z_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s 3vec_float_z_int1 +execute if score 3vec_float_z_exp int > @s 3vec_float_z_exp run scoreboard players set sstempr int 0 +execute if score 3vec_float_z_exp int = @s 3vec_float_z_exp if score 3vec_float_z_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 +#指数 +scoreboard players operation sstempe int = 3vec_float_z_exp int +scoreboard players operation sstempe int -= @s 3vec_float_z_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/3vec_float/rmv_swapz +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation 3vec_float_z_int0 int -= sstemp1 int +#对齐小数点 +execute if score 3vec_float_z_int0 int matches 100000.. run function math:hpo/3vec_float/addz_search/align_s2 +execute if score 3vec_float_z_int0 int matches 100..99999 run function math:hpo/3vec_float/addz_search/align_s1 +execute if score 3vec_float_z_int0 int matches 0..99 run function math:hpo/3vec_float/addz_search/align_s0 +scoreboard players operation 3vec_float_z_int1 int = 3vec_float_z_int0 int +scoreboard players operation 3vec_float_z_int0 int /= 10000 int +scoreboard players operation 3vec_float_z_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprint.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprint.mcfunction new file mode 100644 index 00000000..d0d387e9 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprint.mcfunction @@ -0,0 +1,26 @@ +#math:hpo/3vec_float/_ssprint +tellraw @a "---3vec_float---" + +data modify storage math:io stemp set value {list_zero:[]} +execute if score 3vec_float_x_sign int matches 0.. run data modify storage math:io stemp.sign set value "" +execute if score 3vec_float_x_sign int matches -1 run data modify storage math:io stemp.sign set value "-" +execute if score 3vec_float_x_int1 int matches ..999 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_x_int1 int matches ..99 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_x_int1 int matches ..9 run data modify storage math:io stemp.list_zero append value "0" +tellraw @a ["(float)x: ",{"nbt":"stemp.sign","storage":"math:io"},"0.",{"score":{"name":"3vec_float_x_int0","objective":"int"}},{"nbt":"stemp.list_zero","storage":"math:io","interpret":true},{"score":{"name":"3vec_float_x_int1","objective":"int"}},", E",{"score":{"name":"3vec_float_x_exp","objective":"int"}}] + +data modify storage math:io stemp set value {list_zero:[]} +execute if score 3vec_float_y_sign int matches 0.. run data modify storage math:io stemp.sign set value "" +execute if score 3vec_float_y_sign int matches -1 run data modify storage math:io stemp.sign set value "-" +execute if score 3vec_float_y_int1 int matches ..999 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_y_int1 int matches ..99 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_y_int1 int matches ..9 run data modify storage math:io stemp.list_zero append value "0" +tellraw @a ["(float)y: ",{"nbt":"stemp.sign","storage":"math:io"},"0.",{"score":{"name":"3vec_float_y_int0","objective":"int"}},{"nbt":"stemp.list_zero","storage":"math:io","interpret":true},{"score":{"name":"3vec_float_y_int1","objective":"int"}},", E",{"score":{"name":"3vec_float_y_exp","objective":"int"}}] + +data modify storage math:io stemp set value {list_zero:[]} +execute if score 3vec_float_z_sign int matches 0.. run data modify storage math:io stemp.sign set value "" +execute if score 3vec_float_z_sign int matches -1 run data modify storage math:io stemp.sign set value "-" +execute if score 3vec_float_z_int1 int matches ..999 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_z_int1 int matches ..99 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_z_int1 int matches ..9 run data modify storage math:io stemp.list_zero append value "0" +tellraw @a ["(float)z: ",{"nbt":"stemp.sign","storage":"math:io"},"0.",{"score":{"name":"3vec_float_z_int0","objective":"int"}},{"nbt":"stemp.list_zero","storage":"math:io","interpret":true},{"score":{"name":"3vec_float_z_int1","objective":"int"}},", E",{"score":{"name":"3vec_float_z_exp","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintx.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintx.mcfunction new file mode 100644 index 00000000..0b10c4b5 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintx.mcfunction @@ -0,0 +1,7 @@ +data modify storage math:io stemp set value {list_zero:[]} +execute if score 3vec_float_x_sign int matches 0.. run data modify storage math:io stemp.sign set value "" +execute if score 3vec_float_x_sign int matches -1 run data modify storage math:io stemp.sign set value "-" +execute if score 3vec_float_x_int1 int matches ..999 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_x_int1 int matches ..99 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_x_int1 int matches ..9 run data modify storage math:io stemp.list_zero append value "0" +tellraw @a ["(float)x: ",{"nbt":"stemp.sign","storage":"math:io"},"0.",{"score":{"name":"3vec_float_x_int0","objective":"int"}},{"nbt":"stemp.list_zero","storage":"math:io","interpret":true},{"score":{"name":"3vec_float_x_int1","objective":"int"}},", E",{"score":{"name":"3vec_float_x_exp","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprinty.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprinty.mcfunction new file mode 100644 index 00000000..9bc1d1f3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprinty.mcfunction @@ -0,0 +1,7 @@ +data modify storage math:io stemp set value {list_zero:[]} +execute if score 3vec_float_y_sign int matches 0.. run data modify storage math:io stemp.sign set value "" +execute if score 3vec_float_y_sign int matches -1 run data modify storage math:io stemp.sign set value "-" +execute if score 3vec_float_y_int1 int matches ..999 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_y_int1 int matches ..99 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_y_int1 int matches ..9 run data modify storage math:io stemp.list_zero append value "0" +tellraw @a ["(float)y: ",{"nbt":"stemp.sign","storage":"math:io"},"0.",{"score":{"name":"3vec_float_y_int0","objective":"int"}},{"nbt":"stemp.list_zero","storage":"math:io","interpret":true},{"score":{"name":"3vec_float_y_int1","objective":"int"}},", E",{"score":{"name":"3vec_float_y_exp","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintz.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintz.mcfunction new file mode 100644 index 00000000..44366e10 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssprintz.mcfunction @@ -0,0 +1,7 @@ +data modify storage math:io stemp set value {list_zero:[]} +execute if score 3vec_float_z_sign int matches 0.. run data modify storage math:io stemp.sign set value "" +execute if score 3vec_float_z_sign int matches -1 run data modify storage math:io stemp.sign set value "-" +execute if score 3vec_float_z_int1 int matches ..999 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_z_int1 int matches ..99 run data modify storage math:io stemp.list_zero append value "0" +execute if score 3vec_float_z_int1 int matches ..9 run data modify storage math:io stemp.list_zero append value "0" +tellraw @a ["(float)z: ",{"nbt":"stemp.sign","storage":"math:io"},"0.",{"score":{"name":"3vec_float_z_int0","objective":"int"}},{"nbt":"stemp.list_zero","storage":"math:io","interpret":true},{"score":{"name":"3vec_float_z_int1","objective":"int"}},", E",{"score":{"name":"3vec_float_z_exp","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssrandnew.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssrandnew.mcfunction new file mode 100644 index 00000000..ddaf83cd --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_ssrandnew.mcfunction @@ -0,0 +1,27 @@ +#math:hpo/3vec_float/_ssrandnew +#需要传入世界实体为执行者 + +scoreboard players set min int -1800000 +scoreboard players set max int 1800000 +function math:_random +execute store result entity @s Rotation[0] float 0.0001 run scoreboard players get random int + +scoreboard players set min int -900000 +scoreboard players set max int 900000 +function math:_random +execute store result entity @s Rotation[1] float 0.0001 run scoreboard players get random int + +scoreboard players set min int 6400 +scoreboard players set max int 32000 +function math:_random +execute at @s positioned 0.0 0.0 0.0 run tp @s ^ ^ ^1.0 +execute store result score 3vec_x int run data get entity @s Pos[0] 10000 +execute store result score 3vec_y int run data get entity @s Pos[1] 10000 +execute store result score 3vec_z int run data get entity @s Pos[2] 10000 +scoreboard players operation 3vec_x int *= random int +scoreboard players operation 3vec_x int /= 10000 int +scoreboard players operation 3vec_y int *= random int +scoreboard players operation 3vec_y int /= 10000 int +scoreboard players operation 3vec_z int *= random int +scoreboard players operation 3vec_z int /= 10000 int +function math:hpo/3vec_float/_vecto \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_store.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_store.mcfunction new file mode 100644 index 00000000..a0849430 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_store.mcfunction @@ -0,0 +1,13 @@ +#math:hpo/3vec_float/_store +scoreboard players operation @s 3vec_float_x_sign = 3vec_float_x_sign int +scoreboard players operation @s 3vec_float_y_sign = 3vec_float_y_sign int +scoreboard players operation @s 3vec_float_z_sign = 3vec_float_z_sign int +scoreboard players operation @s 3vec_float_x_int0 = 3vec_float_x_int0 int +scoreboard players operation @s 3vec_float_y_int0 = 3vec_float_y_int0 int +scoreboard players operation @s 3vec_float_z_int0 = 3vec_float_z_int0 int +scoreboard players operation @s 3vec_float_x_int1 = 3vec_float_x_int1 int +scoreboard players operation @s 3vec_float_y_int1 = 3vec_float_y_int1 int +scoreboard players operation @s 3vec_float_z_int1 = 3vec_float_z_int1 int +scoreboard players operation @s 3vec_float_x_exp = 3vec_float_x_exp int +scoreboard players operation @s 3vec_float_y_exp = 3vec_float_y_exp int +scoreboard players operation @s 3vec_float_z_exp = 3vec_float_z_exp int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_swap.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_swap.mcfunction new file mode 100644 index 00000000..c85ac8e0 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_swap.mcfunction @@ -0,0 +1,16 @@ +#math:hpo/3vec_float/_swap +scoreboard players operation 3vec_float_x_sign int >< @s 3vec_float_x_sign +scoreboard players operation 3vec_float_y_sign int >< @s 3vec_float_y_sign +scoreboard players operation 3vec_float_z_sign int >< @s 3vec_float_z_sign + +scoreboard players operation 3vec_float_x_int0 int >< @s 3vec_float_x_int0 +scoreboard players operation 3vec_float_y_int0 int >< @s 3vec_float_y_int0 +scoreboard players operation 3vec_float_z_int0 int >< @s 3vec_float_z_int0 + +scoreboard players operation 3vec_float_x_int1 int >< @s 3vec_float_x_int1 +scoreboard players operation 3vec_float_y_int1 int >< @s 3vec_float_y_int1 +scoreboard players operation 3vec_float_z_int1 int >< @s 3vec_float_z_int1 + +scoreboard players operation 3vec_float_x_exp int >< @s 3vec_float_x_exp +scoreboard players operation 3vec_float_y_exp int >< @s 3vec_float_y_exp +scoreboard players operation 3vec_float_z_exp int >< @s 3vec_float_z_exp \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_tovec.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_tovec.mcfunction new file mode 100644 index 00000000..3945540a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_tovec.mcfunction @@ -0,0 +1,31 @@ +#math:hpo/3vec_float/_tovec + +#x分量 +scoreboard players operation 3vec_x int = 3vec_float_x_int0 int +scoreboard players operation 3vec_x int *= 10000 int +scoreboard players operation 3vec_x int += 3vec_float_x_int1 int +execute if score 3vec_float_x_exp int matches 3.. run function math:hpo/3vec_float/tovecx/3_6 +execute if score 3vec_float_x_exp int matches 1..2 run function math:hpo/3vec_float/tovecx/1_2 +execute if score 3vec_float_x_exp int matches -1..0 run function math:hpo/3vec_float/tovecx/-1_0 +execute if score 3vec_float_x_exp int matches ..-2 run function math:hpo/3vec_float/tovecx/-4_-2 +scoreboard players operation 3vec_x int *= 3vec_float_x_sign int + +#y分量 +scoreboard players operation 3vec_y int = 3vec_float_y_int0 int +scoreboard players operation 3vec_y int *= 10000 int +scoreboard players operation 3vec_y int += 3vec_float_y_int1 int +execute if score 3vec_float_y_exp int matches 3.. run function math:hpo/3vec_float/tovecy/3_6 +execute if score 3vec_float_y_exp int matches 1..2 run function math:hpo/3vec_float/tovecy/1_2 +execute if score 3vec_float_y_exp int matches -1..0 run function math:hpo/3vec_float/tovecy/-1_0 +execute if score 3vec_float_y_exp int matches ..-2 run function math:hpo/3vec_float/tovecy/-4_-2 +scoreboard players operation 3vec_y int *= 3vec_float_y_sign int + +#z分量 +scoreboard players operation 3vec_z int = 3vec_float_z_int0 int +scoreboard players operation 3vec_z int *= 10000 int +scoreboard players operation 3vec_z int += 3vec_float_z_int1 int +execute if score 3vec_float_z_exp int matches 3.. run function math:hpo/3vec_float/tovecz/3_6 +execute if score 3vec_float_z_exp int matches 1..2 run function math:hpo/3vec_float/tovecz/1_2 +execute if score 3vec_float_z_exp int matches -1..0 run function math:hpo/3vec_float/tovecz/-1_0 +execute if score 3vec_float_z_exp int matches ..-2 run function math:hpo/3vec_float/tovecz/-4_-2 +scoreboard players operation 3vec_z int *= 3vec_float_z_sign int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_unit.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_unit.mcfunction new file mode 100644 index 00000000..36bd4281 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_unit.mcfunction @@ -0,0 +1,25 @@ +#math:hpo/3vec_float/_unit +#需要传入执行者 + +scoreboard players operation float_sign int = 3vec_float_x_sign int +scoreboard players operation float_int0 int = 3vec_float_x_int0 int +scoreboard players operation float_int1 int = 3vec_float_x_int1 int +scoreboard players operation float_exp int = 3vec_float_x_exp int +function math:hpo/float/_sqr +scoreboard players operation @s float_sign = 3vec_float_y_sign int +scoreboard players operation @s float_int0 = 3vec_float_y_int0 int +scoreboard players operation @s float_int1 = 3vec_float_y_int1 int +scoreboard players operation @s float_exp = 3vec_float_y_exp int +function math:hpo/float/_zsqr +function math:hpo/float/_add +scoreboard players operation @s float_sign = 3vec_float_z_sign int +scoreboard players operation @s float_int0 = 3vec_float_z_int0 int +scoreboard players operation @s float_int1 = 3vec_float_z_int1 int +scoreboard players operation @s float_exp = 3vec_float_z_exp int +function math:hpo/float/_zsqr +function math:hpo/float/_add + +function math:hpo/float/_sqrt +function math:hpo/float/_store + +function math:hpo/3vec_float/_div \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_vecto.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_vecto.mcfunction new file mode 100644 index 00000000..e73e5004 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/_vecto.mcfunction @@ -0,0 +1,46 @@ +#math:hpo/3vec_float/_vecto + +#符号 +execute store result score 3vec_float_x_int0 int run scoreboard players operation 3vec_float_x_sign int = 3vec_x int +execute if score 3vec_float_x_int0 int matches ..-1 run scoreboard players operation 3vec_float_x_int0 int *= -1 int +scoreboard players operation 3vec_float_x_sign int /= 3vec_float_x_int0 int +#指数 +scoreboard players set 3vec_float_x_exp int 4 +#对齐小数点 +execute if score 3vec_float_x_int0 int matches 100000.. run function math:hpo/3vec_float/addx_search/align_s2 +execute if score 3vec_float_x_int0 int matches 100..99999 run function math:hpo/3vec_float/addx_search/align_s1 +execute if score 3vec_float_x_int0 int matches 0..99 run function math:hpo/3vec_float/addx_search/align_s0 +#高位低位 +scoreboard players operation 3vec_float_x_int1 int = 3vec_float_x_int0 int +scoreboard players operation 3vec_float_x_int0 int /= 10000 int +scoreboard players operation 3vec_float_x_int1 int %= 10000 int + +#符号 +execute store result score 3vec_float_y_int0 int run scoreboard players operation 3vec_float_y_sign int = 3vec_y int +execute if score 3vec_float_y_int0 int matches ..-1 run scoreboard players operation 3vec_float_y_int0 int *= -1 int +scoreboard players operation 3vec_float_y_sign int /= 3vec_float_y_int0 int +#指数 +scoreboard players set 3vec_float_y_exp int 4 +#对齐小数点 +execute if score 3vec_float_y_int0 int matches 100000.. run function math:hpo/3vec_float/addy_search/align_s2 +execute if score 3vec_float_y_int0 int matches 100..99999 run function math:hpo/3vec_float/addy_search/align_s1 +execute if score 3vec_float_y_int0 int matches 0..99 run function math:hpo/3vec_float/addy_search/align_s0 +#高位低位 +scoreboard players operation 3vec_float_y_int1 int = 3vec_float_y_int0 int +scoreboard players operation 3vec_float_y_int0 int /= 10000 int +scoreboard players operation 3vec_float_y_int1 int %= 10000 int + +#符号 +execute store result score 3vec_float_z_int0 int run scoreboard players operation 3vec_float_z_sign int = 3vec_z int +execute if score 3vec_float_z_int0 int matches ..-1 run scoreboard players operation 3vec_float_z_int0 int *= -1 int +scoreboard players operation 3vec_float_z_sign int /= 3vec_float_z_int0 int +#指数 +scoreboard players set 3vec_float_z_exp int 4 +#对齐小数点 +execute if score 3vec_float_z_int0 int matches 100000.. run function math:hpo/3vec_float/addz_search/align_s2 +execute if score 3vec_float_z_int0 int matches 100..99999 run function math:hpo/3vec_float/addz_search/align_s1 +execute if score 3vec_float_z_int0 int matches 0..99 run function math:hpo/3vec_float/addz_search/align_s0 +#高位低位 +scoreboard players operation 3vec_float_z_int1 int = 3vec_float_z_int0 int +scoreboard players operation 3vec_float_z_int0 int /= 10000 int +scoreboard players operation 3vec_float_z_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapx.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapx.mcfunction new file mode 100644 index 00000000..dde3830b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapx.mcfunction @@ -0,0 +1,6 @@ +scoreboard players operation 3vec_float_x_int0 int >< sstemp1 int + +scoreboard players operation 3vec_float_x_exp int = @s 3vec_float_x_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation 3vec_float_x_sign int = @s 3vec_float_x_sign \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapy.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapy.mcfunction new file mode 100644 index 00000000..ab092b65 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapy.mcfunction @@ -0,0 +1,6 @@ +scoreboard players operation 3vec_float_y_int0 int >< sstemp1 int + +scoreboard players operation 3vec_float_y_exp int = @s 3vec_float_y_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation 3vec_float_y_sign int = @s 3vec_float_y_sign \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapz.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapz.mcfunction new file mode 100644 index 00000000..24e352f6 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/add_swapz.mcfunction @@ -0,0 +1,6 @@ +scoreboard players operation 3vec_float_z_int0 int >< sstemp1 int + +scoreboard players operation 3vec_float_z_exp int = @s 3vec_float_z_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation 3vec_float_z_sign int = @s 3vec_float_z_sign \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align0.mcfunction new file mode 100644 index 00000000..215c5c91 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align0.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int *= 10000000 int +scoreboard players remove 3vec_float_x_exp int 7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align1.mcfunction new file mode 100644 index 00000000..1a41711b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align1.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int *= 1000000 int +scoreboard players remove 3vec_float_x_exp int 6 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align2.mcfunction new file mode 100644 index 00000000..c7baeaf6 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align2.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int *= 100000 int +scoreboard players remove 3vec_float_x_exp int 5 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align3.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align3.mcfunction new file mode 100644 index 00000000..1ce30be1 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align3.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int *= 10000 int +scoreboard players remove 3vec_float_x_exp int 4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align4.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align4.mcfunction new file mode 100644 index 00000000..8b5fb350 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align4.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int *= 1000 int +scoreboard players remove 3vec_float_x_exp int 3 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align5.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align5.mcfunction new file mode 100644 index 00000000..3d39d70c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align5.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int *= 100 int +scoreboard players remove 3vec_float_x_exp int 2 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align6.mcfunction new file mode 100644 index 00000000..651e6aee --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align6.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int *= 10 int +scoreboard players remove 3vec_float_x_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align7.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align7.mcfunction new file mode 100644 index 00000000..0b8b160e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align7.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int /= 10 int +scoreboard players add 3vec_float_x_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s0.mcfunction new file mode 100644 index 00000000..59ae1702 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s0.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_x_int0 int matches 0 run function math:hpo/3vec_float/addx_search/zero +execute if score 3vec_float_x_int0 int matches 1..9 run function math:hpo/3vec_float/addx_search/align0 +execute if score 3vec_float_x_int0 int matches 10..99 run function math:hpo/3vec_float/addx_search/align1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s1.mcfunction new file mode 100644 index 00000000..34f01359 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s1.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_x_int0 int matches 100..999 run function math:hpo/3vec_float/addx_search/align2 +execute if score 3vec_float_x_int0 int matches 1000..9999 run function math:hpo/3vec_float/addx_search/align3 +execute if score 3vec_float_x_int0 int matches 10000..99999 run function math:hpo/3vec_float/addx_search/align4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s2.mcfunction new file mode 100644 index 00000000..71d91e79 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/align_s2.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_x_int0 int matches 100000..999999 run function math:hpo/3vec_float/addx_search/align5 +execute if score 3vec_float_x_int0 int matches 1000000..9999999 run function math:hpo/3vec_float/addx_search/align6 +execute if score 3vec_float_x_int0 int matches 100000000.. run function math:hpo/3vec_float/addx_search/align7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/zero.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/zero.mcfunction new file mode 100644 index 00000000..16b7b4f8 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addx_search/zero.mcfunction @@ -0,0 +1,2 @@ +scoreboard players set 3vec_float_x_exp int 0 +scoreboard players set 3vec_float_x_sign int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align0.mcfunction new file mode 100644 index 00000000..6ce45ff3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align0.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int *= 10000000 int +scoreboard players remove 3vec_float_y_exp int 7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align1.mcfunction new file mode 100644 index 00000000..f13f9113 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align1.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int *= 1000000 int +scoreboard players remove 3vec_float_y_exp int 6 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align2.mcfunction new file mode 100644 index 00000000..c5ac28e1 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align2.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int *= 100000 int +scoreboard players remove 3vec_float_y_exp int 5 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align3.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align3.mcfunction new file mode 100644 index 00000000..3deb17a6 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align3.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int *= 10000 int +scoreboard players remove 3vec_float_y_exp int 4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align4.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align4.mcfunction new file mode 100644 index 00000000..efaee0eb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align4.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int *= 1000 int +scoreboard players remove 3vec_float_y_exp int 3 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align5.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align5.mcfunction new file mode 100644 index 00000000..7727bf8b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align5.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int *= 100 int +scoreboard players remove 3vec_float_y_exp int 2 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align6.mcfunction new file mode 100644 index 00000000..5cc56976 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align6.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int *= 10 int +scoreboard players remove 3vec_float_y_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align7.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align7.mcfunction new file mode 100644 index 00000000..89e579bb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align7.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int /= 10 int +scoreboard players add 3vec_float_y_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s0.mcfunction new file mode 100644 index 00000000..a3840c5b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s0.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_y_int0 int matches 0 run function math:hpo/3vec_float/addy_search/zero +execute if score 3vec_float_y_int0 int matches 1..9 run function math:hpo/3vec_float/addy_search/align0 +execute if score 3vec_float_y_int0 int matches 10..99 run function math:hpo/3vec_float/addy_search/align1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s1.mcfunction new file mode 100644 index 00000000..fd04416e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s1.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_y_int0 int matches 100..999 run function math:hpo/3vec_float/addy_search/align2 +execute if score 3vec_float_y_int0 int matches 1000..9999 run function math:hpo/3vec_float/addy_search/align3 +execute if score 3vec_float_y_int0 int matches 10000..99999 run function math:hpo/3vec_float/addy_search/align4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s2.mcfunction new file mode 100644 index 00000000..102b01af --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/align_s2.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_y_int0 int matches 100000..999999 run function math:hpo/3vec_float/addy_search/align5 +execute if score 3vec_float_y_int0 int matches 1000000..9999999 run function math:hpo/3vec_float/addy_search/align6 +execute if score 3vec_float_y_int0 int matches 100000000.. run function math:hpo/3vec_float/addy_search/align7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/zero.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/zero.mcfunction new file mode 100644 index 00000000..76779457 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addy_search/zero.mcfunction @@ -0,0 +1,2 @@ +scoreboard players set 3vec_float_y_exp int 0 +scoreboard players set 3vec_float_y_sign int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align0.mcfunction new file mode 100644 index 00000000..ee0fe852 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align0.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int *= 10000000 int +scoreboard players remove 3vec_float_z_exp int 7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align1.mcfunction new file mode 100644 index 00000000..468f7b93 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align1.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int *= 1000000 int +scoreboard players remove 3vec_float_z_exp int 6 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align2.mcfunction new file mode 100644 index 00000000..6fe21a37 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align2.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int *= 100000 int +scoreboard players remove 3vec_float_z_exp int 5 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align3.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align3.mcfunction new file mode 100644 index 00000000..e5de8a2c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align3.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int *= 10000 int +scoreboard players remove 3vec_float_z_exp int 4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align4.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align4.mcfunction new file mode 100644 index 00000000..0eb0bdd9 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align4.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int *= 1000 int +scoreboard players remove 3vec_float_z_exp int 3 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align5.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align5.mcfunction new file mode 100644 index 00000000..fdb9f201 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align5.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int *= 100 int +scoreboard players remove 3vec_float_z_exp int 2 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align6.mcfunction new file mode 100644 index 00000000..fa20a99f --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align6.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int *= 10 int +scoreboard players remove 3vec_float_z_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align7.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align7.mcfunction new file mode 100644 index 00000000..9504450a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align7.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int /= 10 int +scoreboard players add 3vec_float_z_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s0.mcfunction new file mode 100644 index 00000000..870d8366 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s0.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_z_int0 int matches 0 run function math:hpo/3vec_float/addz_search/zero +execute if score 3vec_float_z_int0 int matches 1..9 run function math:hpo/3vec_float/addz_search/align0 +execute if score 3vec_float_z_int0 int matches 10..99 run function math:hpo/3vec_float/addz_search/align1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s1.mcfunction new file mode 100644 index 00000000..afb661ea --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s1.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_z_int0 int matches 100..999 run function math:hpo/3vec_float/addz_search/align2 +execute if score 3vec_float_z_int0 int matches 1000..9999 run function math:hpo/3vec_float/addz_search/align3 +execute if score 3vec_float_z_int0 int matches 10000..99999 run function math:hpo/3vec_float/addz_search/align4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s2.mcfunction new file mode 100644 index 00000000..9bdfbae0 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/align_s2.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_z_int0 int matches 100000..999999 run function math:hpo/3vec_float/addz_search/align5 +execute if score 3vec_float_z_int0 int matches 1000000..9999999 run function math:hpo/3vec_float/addz_search/align6 +execute if score 3vec_float_z_int0 int matches 100000000.. run function math:hpo/3vec_float/addz_search/align7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/zero.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/zero.mcfunction new file mode 100644 index 00000000..58f1811a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/addz_search/zero.mcfunction @@ -0,0 +1,2 @@ +scoreboard players set 3vec_float_z_exp int 0 +scoreboard players set 3vec_float_z_sign int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/doc.txt b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/doc.txt new file mode 100644 index 00000000..52468ff8 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/doc.txt @@ -0,0 +1,6 @@ +#3vec_float临时对象 +{ + <3vec_float_x_sign>,<3vec_float_x_int0>,<3vec_float_x_int1>,<3vec_float_x_exp>, + <3vec_float_y_sign>,<3vec_float_y_int0>,<3vec_float_y_int1>,<3vec_float_y_exp>, + <3vec_float_z_sign>,<3vec_float_z_int0>,<3vec_float_z_int1>,<3vec_float_z_exp> +} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignx.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignx.mcfunction new file mode 100644 index 00000000..0b8b160e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignx.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_x_int0 int /= 10 int +scoreboard players add 3vec_float_x_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_aligny.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_aligny.mcfunction new file mode 100644 index 00000000..89e579bb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_aligny.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_y_int0 int /= 10 int +scoreboard players add 3vec_float_y_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignz.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignz.mcfunction new file mode 100644 index 00000000..9504450a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/mult_alignz.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation 3vec_float_z_int0 int /= 10 int +scoreboard players add 3vec_float_z_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapx.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapx.mcfunction new file mode 100644 index 00000000..c28cfc03 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapx.mcfunction @@ -0,0 +1,7 @@ +scoreboard players operation 3vec_float_x_int0 int >< sstemp1 int + +scoreboard players operation 3vec_float_x_exp int = @s 3vec_float_x_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation 3vec_float_x_sign int = @s 3vec_float_x_sign +scoreboard players operation 3vec_float_x_sign int *= -1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapy.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapy.mcfunction new file mode 100644 index 00000000..20228027 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapy.mcfunction @@ -0,0 +1,7 @@ +scoreboard players operation 3vec_float_y_int0 int >< sstemp1 int + +scoreboard players operation 3vec_float_y_exp int = @s 3vec_float_y_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation 3vec_float_y_sign int = @s 3vec_float_y_sign +scoreboard players operation 3vec_float_y_sign int *= -1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapz.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapz.mcfunction new file mode 100644 index 00000000..d10b9119 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/rmv_swapz.mcfunction @@ -0,0 +1,7 @@ +scoreboard players operation 3vec_float_z_int0 int >< sstemp1 int + +scoreboard players operation 3vec_float_z_exp int = @s 3vec_float_z_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation 3vec_float_z_sign int = @s 3vec_float_z_sign +scoreboard players operation 3vec_float_z_sign int *= -1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/temp b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/temp new file mode 100644 index 00000000..c39c02cc --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/temp @@ -0,0 +1,33 @@ +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s float_sign +scoreboard players operation sstemp_sign int *= float_sign int +scoreboard players set sstempr int 1 +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int +scoreboard players operation sstemp1 int = @s float_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s float_int1 +execute if score float_exp int > @s float_exp run scoreboard players set sstempr int 0 +execute if score float_exp int = @s float_exp if score float_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 + +#指数 +scoreboard players operation sstempe int = float_exp int +scoreboard players operation sstempe int -= @s float_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/float/add_swap +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation float_int0 int += sstemp1 int + +#对齐小数点 +execute if score float_int0 int matches 100000.. run function math:hpo/float/add_search/align_s2 +execute if score float_int0 int matches 100..99999 run function math:hpo/float/add_search/align_s1 +execute if score float_int0 int matches 0..99 run function math:hpo/float/add_search/align_s0 + +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/length.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/length.mcfunction new file mode 100644 index 00000000..49d4b870 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/length.mcfunction @@ -0,0 +1,10 @@ +#math:hpo/3vec_float/test/length + +scoreboard players operation test int = rand_seed int +#scoreboard players operation rand_seed int = test int + +tellraw @a "---3vec_float_length_test---" +execute as @e[tag=math_marker,limit=1] run function math:hpo/3vec_float/_ssrandnew +function math:hpo/3vec_float/_unit +function math:hpo/3vec_float/_length +function math:hpo/float/_ssprint \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/main.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/main.mcfunction new file mode 100644 index 00000000..d2080c11 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/main.mcfunction @@ -0,0 +1,19 @@ +#math:hpo/3vec_float/test/main +#传入世界实体为执行者 + +scoreboard players set 3vec_n int 50 + +execute as @e[tag=vec0,limit=1] run function math:hpo/3vec_float/_get +function math:hpo/3vec_float/_tovec +scoreboard players set particle int 9 +function math:3vec/_dsp-ex + +execute as @e[tag=vec1,limit=1] run function math:hpo/3vec_float/_get +function math:hpo/3vec_float/_tovec +scoreboard players set particle int 10 +function math:3vec/_dsp-ex + +execute as @e[tag=vec2,limit=1] run function math:hpo/3vec_float/_get +function math:hpo/3vec_float/_tovec +scoreboard players set particle int 11 +function math:3vec/_dsp-ex \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/new.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/new.mcfunction new file mode 100644 index 00000000..dd0d2df3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/test/new.mcfunction @@ -0,0 +1,29 @@ +#math:hpo/3vec_float/test/new + +scoreboard players operation test int = rand_seed int +#scoreboard players operation rand_seed int = test int + +tellraw @a "---3vec_float_new_test---" + +kill @e[tag=test] +summon marker 0 11 0 {Tags:["vec0","test"]} +summon marker 0 11 0 {Tags:["vec1","test"]} +summon marker 0 11 0 {Tags:["vec2","test"]} + +execute as @e[tag=math_marker,limit=1] run function math:hpo/3vec_float/_ssrandnew +function math:hpo/3vec_float/_ssprint +execute as @e[tag=vec0,limit=1] run function math:hpo/3vec_float/_store + +scoreboard players set inp int 20000 +function math:hpo/float/_scoreto +function math:hpo/float/_store +function math:hpo/3vec_float/_mult +function math:hpo/3vec_float/_ssprint +execute as @e[tag=vec1,limit=1] run function math:hpo/3vec_float/_store + +scoreboard players set inp int 40000 +function math:hpo/float/_scoreto +function math:hpo/float/_store +function math:hpo/3vec_float/_div +function math:hpo/3vec_float/_ssprint +execute as @e[tag=vec2,limit=1] run function math:hpo/3vec_float/_store \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-1_0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-1_0.mcfunction new file mode 100644 index 00000000..b5c6c4d9 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-1_0.mcfunction @@ -0,0 +1,2 @@ +execute if score 3vec_float_x_exp int matches 0 run scoreboard players operation 3vec_x int /= 10000 int +execute if score 3vec_float_x_exp int matches -1 run scoreboard players operation 3vec_x int /= 100000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-4_-2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-4_-2.mcfunction new file mode 100644 index 00000000..3f7e26d3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/-4_-2.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_x_exp int matches -2 run scoreboard players operation 3vec_x int /= 1000000 int +execute if score 3vec_float_x_exp int matches -3 run scoreboard players operation 3vec_x int /= 10000000 int +execute if score 3vec_float_x_exp int matches ..-4 run scoreboard players operation 3vec_x int /= 100000000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/1_2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/1_2.mcfunction new file mode 100644 index 00000000..989c8917 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/1_2.mcfunction @@ -0,0 +1,2 @@ +execute if score 3vec_float_x_exp int matches 2 run scoreboard players operation 3vec_x int /= 100 int +execute if score 3vec_float_x_exp int matches 1 run scoreboard players operation 3vec_x int /= 1000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/3_6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/3_6.mcfunction new file mode 100644 index 00000000..a3b87c9c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecx/3_6.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_x_exp int matches 6.. run scoreboard players operation 3vec_x int *= 100 int +execute if score 3vec_float_x_exp int matches 5 run scoreboard players operation 3vec_x int *= 10 int +execute if score 3vec_float_x_exp int matches 3 run scoreboard players operation 3vec_x int /= 10 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-1_0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-1_0.mcfunction new file mode 100644 index 00000000..7ba5522d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-1_0.mcfunction @@ -0,0 +1,2 @@ +execute if score 3vec_float_y_exp int matches 0 run scoreboard players operation 3vec_y int /= 10000 int +execute if score 3vec_float_y_exp int matches -1 run scoreboard players operation 3vec_y int /= 100000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-4_-2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-4_-2.mcfunction new file mode 100644 index 00000000..ec59c9a4 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/-4_-2.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_y_exp int matches -2 run scoreboard players operation 3vec_y int /= 1000000 int +execute if score 3vec_float_y_exp int matches -3 run scoreboard players operation 3vec_y int /= 10000000 int +execute if score 3vec_float_y_exp int matches ..-4 run scoreboard players operation 3vec_y int /= 100000000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/1_2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/1_2.mcfunction new file mode 100644 index 00000000..98bc5fe5 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/1_2.mcfunction @@ -0,0 +1,2 @@ +execute if score 3vec_float_y_exp int matches 2 run scoreboard players operation 3vec_y int /= 100 int +execute if score 3vec_float_y_exp int matches 1 run scoreboard players operation 3vec_y int /= 1000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/3_6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/3_6.mcfunction new file mode 100644 index 00000000..12a8bc66 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecy/3_6.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_y_exp int matches 6.. run scoreboard players operation 3vec_y int *= 100 int +execute if score 3vec_float_y_exp int matches 5 run scoreboard players operation 3vec_y int *= 10 int +execute if score 3vec_float_y_exp int matches 3 run scoreboard players operation 3vec_y int /= 10 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-1_0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-1_0.mcfunction new file mode 100644 index 00000000..a0c1e579 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-1_0.mcfunction @@ -0,0 +1,2 @@ +execute if score 3vec_float_z_exp int matches 0 run scoreboard players operation 3vec_z int /= 10000 int +execute if score 3vec_float_z_exp int matches -1 run scoreboard players operation 3vec_z int /= 100000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-4_-2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-4_-2.mcfunction new file mode 100644 index 00000000..c941e7b5 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/-4_-2.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_z_exp int matches -2 run scoreboard players operation 3vec_z int /= 1000000 int +execute if score 3vec_float_z_exp int matches -3 run scoreboard players operation 3vec_z int /= 10000000 int +execute if score 3vec_float_z_exp int matches ..-4 run scoreboard players operation 3vec_z int /= 100000000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/1_2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/1_2.mcfunction new file mode 100644 index 00000000..d66f00a2 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/1_2.mcfunction @@ -0,0 +1,2 @@ +execute if score 3vec_float_z_exp int matches 2 run scoreboard players operation 3vec_z int /= 100 int +execute if score 3vec_float_z_exp int matches 1 run scoreboard players operation 3vec_z int /= 1000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/3_6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/3_6.mcfunction new file mode 100644 index 00000000..44d2243c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/3vec_float/tovecz/3_6.mcfunction @@ -0,0 +1,3 @@ +execute if score 3vec_float_z_exp int matches 6.. run scoreboard players operation 3vec_z int *= 100 int +execute if score 3vec_float_z_exp int matches 5 run scoreboard players operation 3vec_z int *= 10 int +execute if score 3vec_float_z_exp int matches 3 run scoreboard players operation 3vec_z int /= 10 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/_3div.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/_3div.mcfunction new file mode 100644 index 00000000..4b83fafa --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/_3div.mcfunction @@ -0,0 +1,24 @@ +#math:hpo/_3div +#[1,2147483],1 +#[2147484,8589935],2 +#[8589936,1000000000],25 + +execute if score inp int matches ..-1 run function math:hpo/3div_resign +scoreboard players set sstemp0 int 1000 +scoreboard players set sstemp1 int 1 +execute if score inp int matches 2147484..8589935 run scoreboard players set sstemp1 int 2 +execute if score inp int matches 8589936.. run scoreboard players set sstemp1 int 25 + +scoreboard players operation sstemp0 int /= sstemp1 int +scoreboard players operation sstemp2 int = inp int +scoreboard players operation sstemp2 int /= sstemp1 int +scoreboard players operation sstemp1 int = res int + +scoreboard players operation res int /= sstemp2 int +scoreboard players operation res int *= sstemp0 int + +scoreboard players operation sstemp1 int %= sstemp2 int +scoreboard players operation sstemp1 int *= sstemp0 int +scoreboard players operation sstemp1 int /= sstemp2 int + +scoreboard players operation res int += sstemp1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/_4div.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/_4div.mcfunction new file mode 100644 index 00000000..ca36ff9d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/_4div.mcfunction @@ -0,0 +1,25 @@ +#math:hpo/_4div +#[1,2147483],1 +#[2147484,8589935],2 +#[8589936,1000000000],25 + +execute if score inp int matches ..-1 run function math:hpo/3div_resign +scoreboard players operation res int *= 10 int +scoreboard players set sstemp0 int 1000 +scoreboard players set sstemp1 int 1 +execute if score inp int matches 2147484..8589935 run scoreboard players set sstemp1 int 2 +execute if score inp int matches 8589936.. run scoreboard players set sstemp1 int 25 + +scoreboard players operation sstemp0 int /= sstemp1 int +scoreboard players operation sstemp2 int = inp int +scoreboard players operation sstemp2 int /= sstemp1 int +scoreboard players operation sstemp1 int = res int + +scoreboard players operation res int /= sstemp2 int +scoreboard players operation res int *= sstemp0 int + +scoreboard players operation sstemp1 int %= sstemp2 int +scoreboard players operation sstemp1 int *= sstemp0 int +scoreboard players operation sstemp1 int /= sstemp2 int + +scoreboard players operation res int += sstemp1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_add.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_add.mcfunction new file mode 100644 index 00000000..2c826748 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_add.mcfunction @@ -0,0 +1,34 @@ +#math:hpo/float/_add +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s float_sign +scoreboard players operation sstemp_sign int *= float_sign int +scoreboard players set sstempr int 1 +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int +scoreboard players operation sstemp1 int = @s float_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s float_int1 +execute if score float_exp int > @s float_exp run scoreboard players set sstempr int 0 +execute if score float_exp int = @s float_exp if score float_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 + +#指数 +scoreboard players operation sstempe int = float_exp int +scoreboard players operation sstempe int -= @s float_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/float/add_swap +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation float_int0 int += sstemp1 int + +#对齐小数点 +execute if score float_int0 int matches 100000.. run function math:hpo/float/add_search/align_s2 +execute if score float_int0 int matches 100..99999 run function math:hpo/float/add_search/align_s1 +execute if score float_int0 int matches 0..99 run function math:hpo/float/add_search/align_s0 + +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_cmp.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_cmp.mcfunction new file mode 100644 index 00000000..4819cd2a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_cmp.mcfunction @@ -0,0 +1,14 @@ +#math:hpo/float/_cmp +#返回比较大小结果到,返回绝对值比较大小结果到 +scoreboard players set sres int 0 +execute if score @s float_exp > float_exp int run scoreboard players set sres int 1 +execute if score @s float_exp < float_exp int run scoreboard players set sres int -1 +execute if score sres int matches 0 if score @s float_int0 > float_int0 int run scoreboard players set sres int 1 +execute if score sres int matches 0 if score @s float_int0 < float_int0 int run scoreboard players set sres int -1 +execute if score sres int matches 0 if score @s float_int1 > float_int1 int run scoreboard players set sres int 1 +execute if score sres int matches 0 if score @s float_int1 < float_int1 int run scoreboard players set sres int -1 + +scoreboard players operation res int = sres int +execute if score @s float_sign = float_sign int if score float_sign int matches -1 run scoreboard players operation res int *= -1 int +execute if score @s float_sign > float_sign int run scoreboard players set res int 1 +execute if score @s float_sign < float_sign int run scoreboard players set res int -1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_div.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_div.mcfunction new file mode 100644 index 00000000..7d5a3208 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_div.mcfunction @@ -0,0 +1,45 @@ +#math:hpo/float/_div + +#由万进制节计算除数和被除数 +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int +scoreboard players operation float_int0 int *= 10 int +scoreboard players operation sstempd int = @s float_int0 +scoreboard players operation sstempd int *= 10000 int +scoreboard players operation sstempd int += @s float_int1 + +#计算结果前后4位精度 +scoreboard players operation sstemp0 int = sstempd int +scoreboard players operation sstempd int /= 25 int +scoreboard players operation sstemp0 int %= 25 int +scoreboard players operation sstemp1 int = float_int0 int +scoreboard players operation float_int0 int /= sstempd int +scoreboard players operation float_int0 int *= 40 int +scoreboard players operation sstemp1 int %= sstempd int +scoreboard players operation sstemp1 int *= 40 int +scoreboard players operation float_int1 int = sstemp1 int +scoreboard players operation sstemp1 int /= sstempd int +scoreboard players operation float_int0 int += sstemp1 int +scoreboard players operation float_int1 int %= sstempd int +scoreboard players operation float_int1 int *= 25 int +scoreboard players operation sstemp2 int = sstemp0 int +scoreboard players operation sstemp2 int *= float_int0 int +scoreboard players operation float_int1 int -= sstemp2 int +scoreboard players operation float_int1 int *= 10 int +scoreboard players operation sstemp1 int = float_int1 int +scoreboard players operation float_int1 int /= sstempd int +scoreboard players operation float_int1 int *= 40 int +scoreboard players operation sstemp1 int %= sstempd int +scoreboard players operation sstemp1 int *= 40 int +scoreboard players operation sstemp1 int /= sstempd int +scoreboard players operation float_int1 int += sstemp1 int + +#对齐小数点 +execute if score float_int0 int matches 10000.. run function math:hpo/float/div_align + +#符号位 +scoreboard players operation float_sign int *= @s float_sign +#指数 +scoreboard players operation float_exp int -= @s float_exp +#0的指数校准 +execute if score float_sign int matches 0 run scoreboard players set float_exp int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_equal.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_equal.mcfunction new file mode 100644 index 00000000..c56d4e19 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_equal.mcfunction @@ -0,0 +1,6 @@ +#return @s == ssobj +execute unless score @s float_sign = float_sign int run return 0 +execute unless score @s float_exp = float_exp int run return 0 +execute unless score @s float_int0 = float_int0 int run return 0 +execute unless score @s float_int1 = float_int1 int run return 0 +return 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_get.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_get.mcfunction new file mode 100644 index 00000000..ce3d84da --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_get.mcfunction @@ -0,0 +1,5 @@ +#math:hpo/float/_get +scoreboard players operation float_sign int = @s float_sign +scoreboard players operation float_int0 int = @s float_int0 +scoreboard players operation float_int1 int = @s float_int1 +scoreboard players operation float_exp int = @s float_exp \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_inverse.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_inverse.mcfunction new file mode 100644 index 00000000..496aee1f --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_inverse.mcfunction @@ -0,0 +1,39 @@ +#math:hpo/float/_inverse + +#由万进制节计算除数和被除数 +scoreboard players operation sstempd int = float_int0 int +scoreboard players operation sstempd int *= 10000 int +scoreboard players operation sstempd int += float_int1 int +scoreboard players set float_int0 int 100000000 + +#计算结果前后4位精度 +scoreboard players operation sstemp0 int = sstempd int +scoreboard players operation sstempd int /= 25 int +scoreboard players operation sstemp0 int %= 25 int +scoreboard players operation sstemp1 int = float_int0 int +scoreboard players operation float_int0 int /= sstempd int +scoreboard players operation float_int0 int *= 40 int +scoreboard players operation sstemp1 int %= sstempd int +scoreboard players operation sstemp1 int *= 40 int +scoreboard players operation float_int1 int = sstemp1 int +scoreboard players operation sstemp1 int /= sstempd int +scoreboard players operation float_int0 int += sstemp1 int +scoreboard players operation float_int1 int %= sstempd int +scoreboard players operation float_int1 int *= 25 int +scoreboard players operation sstemp2 int = sstemp0 int +scoreboard players operation sstemp2 int *= float_int0 int +scoreboard players operation float_int1 int -= sstemp2 int +scoreboard players operation float_int1 int *= 10 int +scoreboard players operation sstemp1 int = float_int1 int +scoreboard players operation float_int1 int /= sstempd int +scoreboard players operation float_int1 int *= 40 int +scoreboard players operation sstemp1 int %= sstempd int +scoreboard players operation sstemp1 int *= 40 int +scoreboard players operation sstemp1 int /= sstempd int +scoreboard players operation float_int1 int += sstemp1 int + +#指数 +scoreboard players operation float_exp int *= -1 int +scoreboard players add float_exp int 1 +#对齐小数点 +execute if score float_int0 int matches 10000.. run function math:hpo/float/div_align \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_isbigger.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_isbigger.mcfunction new file mode 100644 index 00000000..00d40a6b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_isbigger.mcfunction @@ -0,0 +1,6 @@ +#return @s > ssobj +execute if score @s float_sign > float_sign int run return 1 +execute if score @s float_exp > float_exp int run return 1 +execute if score @s float_int0 > float_int0 int run return 1 +execute if score @s float_int1 > float_int1 int run return 1 +return 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_isbiggerorequal.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_isbiggerorequal.mcfunction new file mode 100644 index 00000000..884c5962 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_isbiggerorequal.mcfunction @@ -0,0 +1,6 @@ +#return @s >= ssobj +execute if score @s float_sign >= float_sign int run return 1 +execute if score @s float_exp >= float_exp int run return 1 +execute if score @s float_int0 >= float_int0 int run return 1 +execute if score @s float_int1 >= float_int1 int run return 1 +return 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_issmaller.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_issmaller.mcfunction new file mode 100644 index 00000000..ce6bc284 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_issmaller.mcfunction @@ -0,0 +1,6 @@ +#return @s < ssobj +execute if score @s float_sign < float_sign int run return 1 +execute if score @s float_exp < float_exp int run return 1 +execute if score @s float_int0 < float_int0 int run return 1 +execute if score @s float_int1 < float_int1 int run return 1 +return 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_issmallerorequal.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_issmallerorequal.mcfunction new file mode 100644 index 00000000..c8a43ab0 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_issmallerorequal.mcfunction @@ -0,0 +1,6 @@ +#return @s <= ssobj +execute if score @s float_sign <= float_sign int run return 1 +execute if score @s float_exp <= float_exp int run return 1 +execute if score @s float_int0 <= float_int0 int run return 1 +execute if score @s float_int1 <= float_int1 int run return 1 +return 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_mult.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_mult.mcfunction new file mode 100644 index 00000000..ca5bf982 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_mult.mcfunction @@ -0,0 +1,28 @@ +#math:hpo/float/_mult +#低位 +scoreboard players operation sstemp0 int = float_int0 int +scoreboard players operation sstemp0 int *= @s float_int1 +scoreboard players operation sstemp1 int = float_int1 int +scoreboard players operation sstemp1 int *= @s float_int1 +scoreboard players operation sstemp1 int /= 10000 int +scoreboard players operation float_int1 int *= @s float_int0 +scoreboard players operation float_int1 int += sstemp0 int +scoreboard players operation float_int1 int += sstemp1 int + +#高位 +scoreboard players operation float_int0 int *= @s float_int0 +scoreboard players operation float_int0 int *= 10 int +scoreboard players operation float_int1 int /= 1000 int +scoreboard players operation float_int0 int += float_int1 int + +#符号位 +scoreboard players operation float_sign int *= @s float_sign +#指数位 +scoreboard players operation float_exp int += @s float_exp +scoreboard players remove float_exp int 1 +#小数位对齐 +execute if score float_int0 int matches 100000000.. run function math:hpo/float/mult_align + +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_notequal.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_notequal.mcfunction new file mode 100644 index 00000000..2fc9b827 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_notequal.mcfunction @@ -0,0 +1,6 @@ +#return @s != ssobj +execute unless score @s float_sign = float_sign int run return 1 +execute unless score @s float_exp = float_exp int run return 1 +execute unless score @s float_int0 = float_int0 int run return 1 +execute unless score @s float_int1 = float_int1 int run return 1 +return 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_rmv.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_rmv.mcfunction new file mode 100644 index 00000000..5ba6a42b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_rmv.mcfunction @@ -0,0 +1,34 @@ +#math:hpo/float/_rmv +#判断绝对值大小 +scoreboard players operation sstemp_sign int = @s float_sign +scoreboard players operation sstemp_sign int *= float_sign int +scoreboard players set sstempr int 1 +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int +scoreboard players operation sstemp1 int = @s float_int0 +scoreboard players operation sstemp1 int *= 10000 int +scoreboard players operation sstemp1 int += @s float_int1 +execute if score float_exp int > @s float_exp run scoreboard players set sstempr int 0 +execute if score float_exp int = @s float_exp if score float_int0 int >= sstemp1 int run scoreboard players set sstempr int 0 + +#指数 +scoreboard players operation sstempe int = float_exp int +scoreboard players operation sstempe int -= @s float_exp +#交换使得大数在前 +execute if score sstempr int matches 1 run function math:hpo/float/rmv_swap +#符号 +scoreboard players operation sstemp1 int *= sstemp_sign int +#对齐 +execute if score sstempe int matches 1..2 run function math:hpo/float/add_search/1_2 +execute if score sstempe int matches 3..5 run function math:hpo/float/add_search/3_5 +execute if score sstempe int matches 6.. run function math:hpo/float/add_search/6_8 +scoreboard players operation float_int0 int -= sstemp1 int + +#对齐小数点 +execute if score float_int0 int matches 100000.. run function math:hpo/float/add_search/align_s2 +execute if score float_int0 int matches 100..99999 run function math:hpo/float/add_search/align_s1 +execute if score float_int0 int matches 0..99 run function math:hpo/float/add_search/align_s0 + +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_scoreto.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_scoreto.mcfunction new file mode 100644 index 00000000..83c72dc3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_scoreto.mcfunction @@ -0,0 +1,19 @@ +#math:hpo/float/_scoreto + +#符号 +execute store result score float_int0 int run scoreboard players operation float_sign int = inp int +execute if score float_int0 int matches ..-1 run scoreboard players operation float_int0 int *= -1 int +scoreboard players operation float_sign int /= float_int0 int + +#指数 +scoreboard players set float_exp int 4 + +#对齐小数点 +execute if score float_int0 int matches 100000.. run function math:hpo/float/add_search/align_s2 +execute if score float_int0 int matches 100..99999 run function math:hpo/float/add_search/align_s1 +execute if score float_int0 int matches 0..99 run function math:hpo/float/add_search/align_s0 + +#高位低位 +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_sqr.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_sqr.mcfunction new file mode 100644 index 00000000..fcef1d6c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_sqr.mcfunction @@ -0,0 +1,26 @@ +#math:hpo/float/_sqr +#低位 +scoreboard players operation sstemp0 int = float_int1 int +scoreboard players operation sstemp0 int *= float_int1 int +scoreboard players operation sstemp0 int /= 10000 int +scoreboard players operation float_int1 int *= float_int0 int +scoreboard players operation float_int1 int *= 2 int +scoreboard players operation float_int1 int += sstemp0 int + +#高位 +scoreboard players operation float_int0 int *= float_int0 int +scoreboard players operation float_int0 int *= 10 int +scoreboard players operation float_int1 int /= 1000 int +scoreboard players operation float_int0 int += float_int1 int + +#符号位 +scoreboard players operation float_sign int *= float_sign int +#指数位 +scoreboard players operation float_exp int *= 2 int +scoreboard players remove float_exp int 1 +#小数位对齐 +execute if score float_int0 int matches 100000000.. run function math:hpo/float/mult_align + +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_sqrt.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_sqrt.mcfunction new file mode 100644 index 00000000..ec030553 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_sqrt.mcfunction @@ -0,0 +1,23 @@ +#math:hpo/float/_sqrt + +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int + +scoreboard players operation sstemp0 int = float_exp int +scoreboard players operation sstemp0 int %= 2 int +execute if score sstemp0 int matches 1 run scoreboard players operation float_int0 int *= 10 int + +#指数位 +scoreboard players operation float_exp int /= 2 int + +#高位低位 +scoreboard players operation inp int = float_int0 int +function math:sqrt/_3sqrt +scoreboard players operation res int *= 10 int +scoreboard players operation float_int0 int = res int +#小数位对齐 +execute if score float_int0 int matches 100000000.. run function math:hpo/float/mult_align + +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_ssprint.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_ssprint.mcfunction new file mode 100644 index 00000000..0566da71 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_ssprint.mcfunction @@ -0,0 +1,8 @@ +#math:hpo/float/_ssprint +data modify storage math:io stemp set value {list_zero:[]} +execute if score float_sign int matches 0.. run data modify storage math:io stemp.sign set value "" +execute if score float_sign int matches -1 run data modify storage math:io stemp.sign set value "-" +execute if score float_int1 int matches ..999 run data modify storage math:io stemp.list_zero append value "0" +execute if score float_int1 int matches ..99 run data modify storage math:io stemp.list_zero append value "0" +execute if score float_int1 int matches ..9 run data modify storage math:io stemp.list_zero append value "0" +tellraw @a ["(float) ",{"nbt":"stemp.sign","storage":"math:io"},"0.",{"score":{"name":"float_int0","objective":"int"}},{"nbt":"stemp.list_zero","storage":"math:io","interpret":true},{"score":{"name":"float_int1","objective":"int"}},", E",{"score":{"name":"float_exp","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_ssrandnew.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_ssrandnew.mcfunction new file mode 100644 index 00000000..a7db045d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_ssrandnew.mcfunction @@ -0,0 +1,20 @@ +#math:hpo/float/_ssrandnew +#随机赋值临时对象 +scoreboard players set min int 0 +scoreboard players set max int 1 +function math:_random +scoreboard players operation random int *= 2 int +scoreboard players remove random int 1 +scoreboard players operation float_sign int = random int + +scoreboard players set min int 10000000 +scoreboard players set max int 99999999 +function math:_random +execute store result score float_int1 int run scoreboard players operation float_int0 int = random int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int + +scoreboard players set min int -1000 +scoreboard players set max int 1000000 +function math:_random +scoreboard players operation float_exp int = random int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_store.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_store.mcfunction new file mode 100644 index 00000000..89ee633c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_store.mcfunction @@ -0,0 +1,5 @@ +#math:hpo/float/_store +scoreboard players operation @s float_sign = float_sign int +scoreboard players operation @s float_int0 = float_int0 int +scoreboard players operation @s float_int1 = float_int1 int +scoreboard players operation @s float_exp = float_exp int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_swap.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_swap.mcfunction new file mode 100644 index 00000000..4319acab --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_swap.mcfunction @@ -0,0 +1,5 @@ +#math:hpo/float/_swap +scoreboard players operation float_sign int >< @s float_sign +scoreboard players operation float_int0 int >< @s float_int0 +scoreboard players operation float_int1 int >< @s float_int1 +scoreboard players operation float_exp int >< @s float_exp \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_toscore.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_toscore.mcfunction new file mode 100644 index 00000000..d19b8b52 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_toscore.mcfunction @@ -0,0 +1,12 @@ +#math:hpo/float/_toscore + +scoreboard players operation res int = float_int0 int +scoreboard players operation res int *= 10000 int +scoreboard players operation res int += float_int1 int + +execute if score float_exp int matches 3.. run function math:hpo/float/toscore/3_6 +execute if score float_exp int matches 1..2 run function math:hpo/float/toscore/1_2 +execute if score float_exp int matches -1..0 run function math:hpo/float/toscore/-1_0 +execute if score float_exp int matches ..-2 run function math:hpo/float/toscore/-4_-2 + +scoreboard players operation res int *= float_sign int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/_zsqr.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/_zsqr.mcfunction new file mode 100644 index 00000000..192309df --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/_zsqr.mcfunction @@ -0,0 +1,26 @@ +#math:hpo/float/_zsqr +#低位 +scoreboard players operation sstemp0 int = @s float_int1 +scoreboard players operation sstemp0 int *= @s float_int1 +scoreboard players operation sstemp0 int /= 10000 int +scoreboard players operation @s float_int1 *= @s float_int0 +scoreboard players operation @s float_int1 *= 2 int +scoreboard players operation @s float_int1 += sstemp0 int + +#高位 +scoreboard players operation @s float_int0 *= @s float_int0 +scoreboard players operation @s float_int0 *= 10 int +scoreboard players operation @s float_int1 /= 1000 int +scoreboard players operation @s float_int0 += @s float_int1 + +#符号位 +scoreboard players operation @s float_sign *= @s float_sign +#指数位 +scoreboard players operation @s float_exp *= 2 int +scoreboard players remove @s float_exp 1 +#小数位对齐 +execute if score @s float_int0 matches 100000000.. run function math:hpo/float/zmult_align + +scoreboard players operation @s float_int1 = @s float_int0 +scoreboard players operation @s float_int0 /= 10000 int +scoreboard players operation @s float_int1 %= 10000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/1_2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/1_2.mcfunction new file mode 100644 index 00000000..bd2779f0 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/1_2.mcfunction @@ -0,0 +1,2 @@ +execute if score sstempe int matches 1 run scoreboard players operation sstemp1 int /= 10 int +execute if score sstempe int matches 2 run scoreboard players operation sstemp1 int /= 100 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/3_5.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/3_5.mcfunction new file mode 100644 index 00000000..888919d5 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/3_5.mcfunction @@ -0,0 +1,3 @@ +execute if score sstempe int matches 3 run scoreboard players operation sstemp1 int /= 1000 int +execute if score sstempe int matches 4 run scoreboard players operation sstemp1 int /= 10000 int +execute if score sstempe int matches 5 run scoreboard players operation sstemp1 int /= 100000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/6_8.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/6_8.mcfunction new file mode 100644 index 00000000..bd915917 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/6_8.mcfunction @@ -0,0 +1,3 @@ +execute if score sstempe int matches 6 run scoreboard players operation sstemp1 int /= 1000000 int +execute if score sstempe int matches 7 run scoreboard players operation sstemp1 int /= 10000000 int +execute if score sstempe int matches 8.. run scoreboard players operation sstemp1 int /= 1000000000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align0.mcfunction new file mode 100644 index 00000000..69faab39 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align0.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int *= 10000000 int +scoreboard players remove float_exp int 7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align1.mcfunction new file mode 100644 index 00000000..d1ce3f91 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align1.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int *= 1000000 int +scoreboard players remove float_exp int 6 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align2.mcfunction new file mode 100644 index 00000000..80af224d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align2.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int *= 100000 int +scoreboard players remove float_exp int 5 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align3.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align3.mcfunction new file mode 100644 index 00000000..40c3d2be --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align3.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int *= 10000 int +scoreboard players remove float_exp int 4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align4.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align4.mcfunction new file mode 100644 index 00000000..20c87aeb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align4.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int *= 1000 int +scoreboard players remove float_exp int 3 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align5.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align5.mcfunction new file mode 100644 index 00000000..118e473b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align5.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int *= 100 int +scoreboard players remove float_exp int 2 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align6.mcfunction new file mode 100644 index 00000000..25edbf03 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align6.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int *= 10 int +scoreboard players remove float_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align7.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align7.mcfunction new file mode 100644 index 00000000..8f36da77 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align7.mcfunction @@ -0,0 +1,2 @@ +scoreboard players operation float_int0 int /= 10 int +scoreboard players add float_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s0.mcfunction new file mode 100644 index 00000000..dd0624eb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s0.mcfunction @@ -0,0 +1,3 @@ +execute if score float_int0 int matches 0 run function math:hpo/float/add_search/zero +execute if score float_int0 int matches 1..9 run function math:hpo/float/add_search/align0 +execute if score float_int0 int matches 10..99 run function math:hpo/float/add_search/align1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s1.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s1.mcfunction new file mode 100644 index 00000000..ba4bcde8 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s1.mcfunction @@ -0,0 +1,3 @@ +execute if score float_int0 int matches 100..999 run function math:hpo/float/add_search/align2 +execute if score float_int0 int matches 1000..9999 run function math:hpo/float/add_search/align3 +execute if score float_int0 int matches 10000..99999 run function math:hpo/float/add_search/align4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s2.mcfunction new file mode 100644 index 00000000..3fa1c476 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/align_s2.mcfunction @@ -0,0 +1,3 @@ +execute if score float_int0 int matches 100000..999999 run function math:hpo/float/add_search/align5 +execute if score float_int0 int matches 1000000..9999999 run function math:hpo/float/add_search/align6 +execute if score float_int0 int matches 100000000.. run function math:hpo/float/add_search/align7 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/zero.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/zero.mcfunction new file mode 100644 index 00000000..463c7360 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_search/zero.mcfunction @@ -0,0 +1,2 @@ +scoreboard players set float_exp int 0 +scoreboard players set float_sign int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/add_swap.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/add_swap.mcfunction new file mode 100644 index 00000000..134b0abb --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/add_swap.mcfunction @@ -0,0 +1,8 @@ +#math:hpo/float/add_swap + +scoreboard players operation float_int0 int >< sstemp1 int + +scoreboard players operation float_exp int = @s float_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation float_sign int = @s float_sign \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/datato/_double.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/datato/_double.mcfunction new file mode 100644 index 00000000..678e8e25 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/datato/_double.mcfunction @@ -0,0 +1,3 @@ +#math:hpo/float/datato/_double + +execute store result score sstemp0 int run data get storage math:io double 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/div_align.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/div_align.mcfunction new file mode 100644 index 00000000..0a55a7e7 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/div_align.mcfunction @@ -0,0 +1,8 @@ +#math:hpo/float/div_align +scoreboard players operation float_int0 int *= 10000 int +scoreboard players operation float_int0 int += float_int1 int +scoreboard players operation float_int0 int /= 10 int +scoreboard players operation float_int1 int = float_int0 int +scoreboard players operation float_int0 int /= 10000 int +scoreboard players operation float_int1 int %= 10000 int +scoreboard players add float_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/doc.txt b/mcfpp/math/src/math/data/math/functions/hpo/float/doc.txt new file mode 100644 index 00000000..98f5b133 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/doc.txt @@ -0,0 +1,2 @@ +#float类型的临时对象 +{,,,} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/mult_align.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/mult_align.mcfunction new file mode 100644 index 00000000..ab94ab4e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/mult_align.mcfunction @@ -0,0 +1,4 @@ +#math:hpo/float/mult_align + +scoreboard players operation float_int0 int /= 10 int +scoreboard players add float_exp int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/rmv_swap.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/rmv_swap.mcfunction new file mode 100644 index 00000000..56333e22 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/rmv_swap.mcfunction @@ -0,0 +1,9 @@ +#math:hpo/float/rmv_swap + +scoreboard players operation float_int0 int >< sstemp1 int + +scoreboard players operation float_exp int = @s float_exp +scoreboard players operation sstempe int *= -1 int + +scoreboard players operation float_sign int = @s float_sign +scoreboard players operation float_sign int *= -1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/test/add.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/test/add.mcfunction new file mode 100644 index 00000000..19a2be97 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/test/add.mcfunction @@ -0,0 +1,20 @@ +#math:hpo/float/test/add + +scoreboard players operation test int = rand_seed int +#scoreboard players operation rand_seed int = test int + +tellraw @a "---float_add_test---" +function math:hpo/float/_ssrandnew +function math:hpo/float/_ssprint +function math:hpo/float/_store + +function math:hpo/float/_ssrandnew +scoreboard players set min int -7 +scoreboard players set max int 7 +function math:_random +scoreboard players operation float_exp int = @s float_exp +scoreboard players operation float_exp int += random int +function math:hpo/float/_ssprint + +function math:hpo/float/_add +function math:hpo/float/_ssprint \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/test/div.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/test/div.mcfunction new file mode 100644 index 00000000..8e1c50e4 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/test/div.mcfunction @@ -0,0 +1,20 @@ +#math:hpo/float/test/div + +scoreboard players operation test int = rand_seed int +#scoreboard players operation rand_seed int = test int + +tellraw @a "---float_div_test---" +function math:hpo/float/_ssrandnew +function math:hpo/float/_ssprint +function math:hpo/float/_store + +function math:hpo/float/_ssrandnew +scoreboard players set min int -7 +scoreboard players set max int 7 +function math:_random +scoreboard players operation float_exp int = @s float_exp +scoreboard players operation float_exp int += random int +function math:hpo/float/_ssprint + +function math:hpo/float/_div +function math:hpo/float/_ssprint \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/test/inverse.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/test/inverse.mcfunction new file mode 100644 index 00000000..98e39625 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/test/inverse.mcfunction @@ -0,0 +1,12 @@ +#math:hpo/float/test/inverse + +scoreboard players operation test int = rand_seed int +#scoreboard players operation rand_seed int = test int + +tellraw @a "---float_inverse_test---" +function math:hpo/float/_ssrandnew +function math:hpo/float/_ssprint +function math:hpo/float/_inverse +function math:hpo/float/_ssprint +function math:hpo/float/_inverse +function math:hpo/float/_ssprint \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/test/mult.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/test/mult.mcfunction new file mode 100644 index 00000000..fdaa966b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/test/mult.mcfunction @@ -0,0 +1,20 @@ +#math:hpo/float/test/mult + +scoreboard players operation test int = rand_seed int +#scoreboard players operation rand_seed int = test int + +tellraw @a "---float_mult_test---" +function math:hpo/float/_ssrandnew +function math:hpo/float/_ssprint +function math:hpo/float/_store + +function math:hpo/float/_ssrandnew +scoreboard players set min int -7 +scoreboard players set max int 7 +function math:_random +scoreboard players operation float_exp int = @s float_exp +scoreboard players operation float_exp int += random int +function math:hpo/float/_ssprint + +function math:hpo/float/_mult +function math:hpo/float/_ssprint \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/test/rmv.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/test/rmv.mcfunction new file mode 100644 index 00000000..d99ca616 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/test/rmv.mcfunction @@ -0,0 +1,20 @@ +#math:hpo/float/test/rmv + +#scoreboard players operation test int = rand_seed int +scoreboard players operation rand_seed int = test int + +tellraw @a "---float_rmv_test---" +function math:hpo/float/_ssrandnew +function math:hpo/float/_ssprint +function math:hpo/float/_store + +function math:hpo/float/_ssrandnew +scoreboard players set min int -7 +scoreboard players set max int 7 +function math:_random +scoreboard players operation float_exp int = @s float_exp +scoreboard players operation float_exp int += random int +function math:hpo/float/_ssprint + +function math:hpo/float/_rmv +function math:hpo/float/_ssprint \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/test/sqrt.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/test/sqrt.mcfunction new file mode 100644 index 00000000..c2d1659e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/test/sqrt.mcfunction @@ -0,0 +1,11 @@ +#math:hpo/float/test/sqrt + +scoreboard players operation test int = rand_seed int +#scoreboard players operation rand_seed int = test int + +tellraw @a "---float_sqrt_test---" +function math:hpo/float/_ssrandnew +execute if score float_sign int matches ..-1 run scoreboard players set float_sign int 1 +function math:hpo/float/_ssprint +function math:hpo/float/_sqrt +function math:hpo/float/_ssprint \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/todata/_double.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/_double.mcfunction new file mode 100644 index 00000000..ec3b38c5 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/_double.mcfunction @@ -0,0 +1,11 @@ +#math:hpo/float/todata/_double + +scoreboard players operation sstemp0 int = float_int0 int +scoreboard players operation sstemp0 int *= 10000 int +scoreboard players operation sstemp0 int += float_int1 int +scoreboard players operation sstemp0 int *= float_sign int + +execute if score float_exp int matches ..-4 run function math:hpo/float/todata/search/-7_-4 +execute if score float_exp int matches -3..0 run function math:hpo/float/todata/search/-3_0 +execute if score float_exp int matches 1..4 run function math:hpo/float/todata/search/1_4 +execute if score float_exp int matches 5.. run function math:hpo/float/todata/search/5_8 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-3_0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-3_0.mcfunction new file mode 100644 index 00000000..da7a3ccd --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-3_0.mcfunction @@ -0,0 +1,4 @@ +execute if score float_exp int matches -3 store result storage math:io double double 0.00000000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches -2 store result storage math:io double double 0.0000000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches -1 store result storage math:io double double 0.000000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches 0 store result storage math:io double double 0.00000001 run scoreboard players get sstemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_-4.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_-4.mcfunction new file mode 100644 index 00000000..977c184f --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_-4.mcfunction @@ -0,0 +1,4 @@ +execute if score float_exp int matches ..-7 store result storage math:io double double 0.000000000000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches -6 store result storage math:io double double 0.00000000000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches -5 store result storage math:io double double 0.0000000000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches -4 store result storage math:io double double 0.000000000001 run scoreboard players get sstemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_8.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_8.mcfunction new file mode 100644 index 00000000..52a78b6a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/-7_8.mcfunction @@ -0,0 +1,4 @@ +execute if score float_exp int matches ..-4 run function math:hpo/float/todata/search/-7_-4 +execute if score float_exp int matches -3..0 run function math:hpo/float/todata/search/-3_0 +execute if score float_exp int matches 1..4 run function math:hpo/float/todata/search/1_4 +execute if score float_exp int matches 5.. run function math:hpo/float/todata/search/5_8 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/1_4.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/1_4.mcfunction new file mode 100644 index 00000000..15e9f6dd --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/1_4.mcfunction @@ -0,0 +1,4 @@ +execute if score float_exp int matches 1 store result storage math:io double double 0.0000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches 2 store result storage math:io double double 0.000001 run scoreboard players get sstemp0 int +execute if score float_exp int matches 3 store result storage math:io double double 0.00001 run scoreboard players get sstemp0 int +execute if score float_exp int matches 4 store result storage math:io double double 0.0001 run scoreboard players get sstemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/5_8.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/5_8.mcfunction new file mode 100644 index 00000000..aa79ee40 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/todata/search/5_8.mcfunction @@ -0,0 +1,4 @@ +execute if score float_exp int matches 5 store result storage math:io double double 0.001 run scoreboard players get sstemp0 int +execute if score float_exp int matches 6 store result storage math:io double double 0.01 run scoreboard players get sstemp0 int +execute if score float_exp int matches 7 store result storage math:io double double 0.1 run scoreboard players get sstemp0 int +execute if score float_exp int matches 8.. store result storage math:io double double 1 run scoreboard players get sstemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-1_0.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-1_0.mcfunction new file mode 100644 index 00000000..b1da2250 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-1_0.mcfunction @@ -0,0 +1,2 @@ +execute if score float_exp int matches 0 run scoreboard players operation res int /= 10000 int +execute if score float_exp int matches -1 run scoreboard players operation res int /= 100000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-4_-2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-4_-2.mcfunction new file mode 100644 index 00000000..37f73dc7 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/-4_-2.mcfunction @@ -0,0 +1,3 @@ +execute if score float_exp int matches -2 run scoreboard players operation res int /= 1000000 int +execute if score float_exp int matches -3 run scoreboard players operation res int /= 10000000 int +execute if score float_exp int matches ..-4 run scoreboard players operation res int /= 100000000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/1_2.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/1_2.mcfunction new file mode 100644 index 00000000..64ac07f4 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/1_2.mcfunction @@ -0,0 +1,2 @@ +execute if score float_exp int matches 2 run scoreboard players operation res int /= 100 int +execute if score float_exp int matches 1 run scoreboard players operation res int /= 1000 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/3_6.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/3_6.mcfunction new file mode 100644 index 00000000..f7943e81 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/toscore/3_6.mcfunction @@ -0,0 +1,3 @@ +execute if score float_exp int matches 6.. run scoreboard players operation res int *= 100 int +execute if score float_exp int matches 5 run scoreboard players operation res int *= 10 int +execute if score float_exp int matches 3 run scoreboard players operation res int /= 10 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/float/zmult_align.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/float/zmult_align.mcfunction new file mode 100644 index 00000000..d99fdaaa --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/float/zmult_align.mcfunction @@ -0,0 +1,4 @@ +#math:hpo/float/zmult_align + +scoreboard players operation @s float_int0 /= 10 int +scoreboard players add @s float_exp 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/hpo/init.mcfunction b/mcfpp/math/src/math/data/math/functions/hpo/init.mcfunction new file mode 100644 index 00000000..d26d0290 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/hpo/init.mcfunction @@ -0,0 +1,25 @@ +#math:hpo/init + +#浮点数 +scoreboard objectives add float_sign dummy +scoreboard objectives add float_int0 dummy +scoreboard objectives add float_int1 dummy +scoreboard objectives add float_exp dummy + +#浮点数三维向量 +scoreboard objectives add 3vec_float_x_sign dummy +scoreboard objectives add 3vec_float_x_int0 dummy +scoreboard objectives add 3vec_float_x_int1 dummy +scoreboard objectives add 3vec_float_x_exp dummy +scoreboard objectives add 3vec_float_y_sign dummy +scoreboard objectives add 3vec_float_y_int0 dummy +scoreboard objectives add 3vec_float_y_int1 dummy +scoreboard objectives add 3vec_float_y_exp dummy +scoreboard objectives add 3vec_float_z_sign dummy +scoreboard objectives add 3vec_float_z_int0 dummy +scoreboard objectives add 3vec_float_z_int1 dummy +scoreboard objectives add 3vec_float_z_exp dummy + +#临时对象初始化 +data modify storage math:io double set value 0.0d +data modify storage math:io float set value 0.0f \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/init_overworld.mcfunction b/mcfpp/math/src/math/data/math/functions/init_overworld.mcfunction new file mode 100644 index 00000000..d02f9519 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/init_overworld.mcfunction @@ -0,0 +1,12 @@ +#math:init_overworld + +#空间运算区块 +function math:marker/_origin +#告示牌 +function math:marker/_sign +#箱子 +function math:marker/_chest +#世界实体 +function math:marker/_math +#转发实体 +function math:marker/_uuid \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/marker/_chest.mcfunction b/mcfpp/math/src/math/data/math/functions/marker/_chest.mcfunction new file mode 100644 index 00000000..e7f653a7 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/marker/_chest.mcfunction @@ -0,0 +1,4 @@ +#math:marker/_chest +forceload add 29999984 8591 29999984 8591 +setblock 29999984 0 8592 chest +item replace block 29999984 0 8592 container.0 with glass \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/marker/_math.mcfunction b/mcfpp/math/src/math/data/math/functions/marker/_math.mcfunction new file mode 100644 index 00000000..824ea6c3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/marker/_math.mcfunction @@ -0,0 +1,3 @@ +#math:marker/_math +kill @e[tag=math_marker,type=minecraft:marker] +summon marker 0 11 0 {Tags:["math_marker"],CustomName:'{"text":"math_marker"}',UUID:[I;0,0,-2053963776,0]} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/marker/_origin.mcfunction b/mcfpp/math/src/math/data/math/functions/marker/_origin.mcfunction new file mode 100644 index 00000000..0a01487e --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/marker/_origin.mcfunction @@ -0,0 +1,2 @@ +#math:marker/_origin +forceload add -1 -1 1 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/marker/_return.mcfunction b/mcfpp/math/src/math/data/math/functions/marker/_return.mcfunction new file mode 100644 index 00000000..c9386895 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/marker/_return.mcfunction @@ -0,0 +1,3 @@ +#math:marker/_return +tp @s 0 11 0 +data modify entity @s data set value {} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/marker/_sign.mcfunction b/mcfpp/math/src/math/data/math/functions/marker/_sign.mcfunction new file mode 100644 index 00000000..6d904677 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/marker/_sign.mcfunction @@ -0,0 +1,3 @@ +#math:marker/_sign +forceload add 29999984 8591 29999984 8591 +setblock 29999984 0 8591 oak_sign \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/marker/_uuid.mcfunction b/mcfpp/math/src/math/data/math/functions/marker/_uuid.mcfunction new file mode 100644 index 00000000..790bf445 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/marker/_uuid.mcfunction @@ -0,0 +1,3 @@ +#math:marker/_uuid +kill @e[tag=uuid_marker,type=minecraft:item] +summon item 0 -67 0 {Tags:["uuid_marker"],UUID:[I;0,0,-2053963776,1],NoGravity:1b,PickupDelay:32767s,CustomName:'{"text":"uuid_marker"}',Item:{id:"minecraft:glass",Count:1b}} \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/obj_entity/_new.mcfunction b/mcfpp/math/src/math/data/math/functions/obj_entity/_new.mcfunction new file mode 100644 index 00000000..f3fa655d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/obj_entity/_new.mcfunction @@ -0,0 +1,3 @@ +#math:obj/_entity + +execute summon marker run function math:obj_entity/new_set \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/obj_entity/_reid.mcfunction b/mcfpp/math/src/math/data/math/functions/obj_entity/_reid.mcfunction new file mode 100644 index 00000000..e2927962 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/obj_entity/_reid.mcfunction @@ -0,0 +1,13 @@ +#math:obj_entity/_reid +#重置对象计数器(谨慎使用!!!) +#确保未加载区块无实体对象 +#确保无非实体组实体有int定义 +#会重新分配id和int指针 +execute as @e if score @s id matches ..2147483647 run tag @s add tmp +scoreboard objectives add reid_temp dummy +execute as @e[tag=tmp] run scoreboard players operation @s reid_temp = @s id +scoreboard players set #id id -1 +execute as @e[tag=tmp] store result score @s id run scoreboard players add #id id 1 +execute as @e if score @s int matches ..2147483647 run function math:obj_entity/get_newint +scoreboard objectives remove reid_temp +tag @e remove tmp \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/obj_entity/get_newint.mcfunction b/mcfpp/math/src/math/data/math/functions/obj_entity/get_newint.mcfunction new file mode 100644 index 00000000..af32a859 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/obj_entity/get_newint.mcfunction @@ -0,0 +1,4 @@ +#math:obj_entity/get_newint +scoreboard players operation temp int = @s int +execute as @e[tag=tmp] if score @s reid_temp = temp int run scoreboard players operation temp int = @s id +scoreboard players operation @s int = temp int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/obj_entity/set.mcfunction b/mcfpp/math/src/math/data/math/functions/obj_entity/set.mcfunction new file mode 100644 index 00000000..49b2d695 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/obj_entity/set.mcfunction @@ -0,0 +1,4 @@ +#math:obj_entity/set +execute store result score @s id run scoreboard players add #id id 1 +data modify entity @s Tags set value ["obj_entity"] +data modify storage math:io result set from entity @s UUID \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_append.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_append.mcfunction new file mode 100644 index 00000000..ef2d5908 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_append.mcfunction @@ -0,0 +1,12 @@ +#math:set/_append +#需要传入世界实体为执行者 +data modify block 29999984 0 8591 back_text.messages[0] set value '{"nbt":"input","storage":"math:io"}' + +data modify entity @s Tags set from storage math:io set_tags +data modify entity @s Tags append from block 29999984 0 8591 back_text.messages[0] +data modify storage math:io set_tags set from entity @s Tags + +execute store result score sstemp int if data storage math:io set_tags[] +execute if score sstemp int > set_cnt int run function math:set/append_success + +data modify entity @s Tags set value ["math_marker"] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_cross.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_cross.mcfunction new file mode 100644 index 00000000..071b6d95 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_cross.mcfunction @@ -0,0 +1,18 @@ +#math:set/_cross +# 求交集 +# 输入临时对象,执行者对象 +# 输出临时对象 + +data modify storage math:io stemp_Tags set from entity @s Tags +data modify entity @s Tags set from entity @s data.set_tags +scoreboard players operation sstemp0 int = @s set_cnt + +data modify storage math:io stemp set from storage math:io set +data modify storage math:io stemp_tags set from storage math:io set_tags +scoreboard players operation sloop int = set_cnt int +data modify storage math:io set set value [] +data modify storage math:io set_tags set value [] +scoreboard players set set_cnt int 0 +execute if score sloop int matches 1.. run function math:set/cross_sloop + +data modify entity @s Tags set from storage math:io stemp_Tags \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_diff.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_diff.mcfunction new file mode 100644 index 00000000..75d504e9 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_diff.mcfunction @@ -0,0 +1,19 @@ +#math:set/_diff +# 求差集 +# 用实体对象减去临时对象 +# 输入临时对象,执行者对象 +# 输出临时对象 + +data modify storage math:io stemp_Tags set from entity @s Tags +data modify entity @s Tags set from entity @s data.set_tags +scoreboard players operation sstemp0 int = @s set_cnt + +data modify storage math:io stemp set from storage math:io set +data modify storage math:io stemp_tags set from storage math:io set_tags +scoreboard players operation sloop int = set_cnt int +data modify storage math:io set set value [] +data modify storage math:io set_tags set value [] +scoreboard players set set_cnt int 0 +execute if score sloop int matches 1.. run function math:set/diff_sloop + +data modify entity @s Tags set from storage math:io stemp_Tags \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_ex-tags.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_ex-tags.mcfunction new file mode 100644 index 00000000..891c44e3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_ex-tags.mcfunction @@ -0,0 +1,7 @@ +#math:set/_ex-tags +# 扩展tags属性 + +data modify storage math:io set_tags set value [] +data modify storage math:io stemp set from storage math:io set +scoreboard players operation sloop int = set_cnt int +execute if score sloop int matches 1.. run function math:set/tags_sloop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_get.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_get.mcfunction new file mode 100644 index 00000000..82804cef --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_get.mcfunction @@ -0,0 +1,4 @@ +#math:set/_get +data modify storage math:io set set from entity @s data.set +data modify storage math:io set_tags set from entity @s data.set_tags +scoreboard players operation set_cnt int = @s set_cnt \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_merge.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_merge.mcfunction new file mode 100644 index 00000000..91857f2c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_merge.mcfunction @@ -0,0 +1,14 @@ +#math:set/_merge +# 求并集 +# 输入临时对象,执行者对象 +# 输出临时对象 + +data modify storage math:io stemp_Tags set from entity @s Tags +data modify entity @s Tags set from storage math:io set_tags + +data modify storage math:io stemp set from entity @s data.set +data modify storage math:io stemp_tags set from entity @s data.set_tags +scoreboard players operation sloop int = @s set_cnt +execute if score sloop int matches 1.. run function math:set/merge_sloop + +data modify entity @s Tags set from storage math:io stemp_Tags \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_new.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_new.mcfunction new file mode 100644 index 00000000..08f25c72 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_new.mcfunction @@ -0,0 +1,7 @@ +#math:set/_new +# 输入数据模板storage math:io input +# 返回一个集合对象 + +tag @e remove result +summon marker 0 11 0 {Tags:["result","set"],data:{set:[],set_tags:[]}} +execute as @e[tag=result,limit=1] run function math:set/set \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_of.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_of.mcfunction new file mode 100644 index 00000000..d32cad7a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_of.mcfunction @@ -0,0 +1,14 @@ +#math:set/_of +# 判断元素是否在集合中 +# 需要传入世界实体为执行者 +# 输入storage math:io input +# 输出 + +data modify entity @s Tags set from storage math:io set_tags + +data modify block 29999984 0 8591 back_text.messages[0] set value '{"nbt":"input","storage":"math:io"}' +data modify entity @s Tags append from block 29999984 0 8591 back_text.messages[0] +execute store result score sstemp int if data entity @s Tags[] +execute store result score res int if score sstemp int = set_cnt int + +data modify entity @s Tags set value ["math_marker"] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_print.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_print.mcfunction new file mode 100644 index 00000000..89ae69d8 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_print.mcfunction @@ -0,0 +1,6 @@ +#math:set/_print + +tellraw @a "---set---" +tellraw @a ["set: ",{"nbt":"data.set","entity":"@s"}] +tellraw @a ["set_tags: ",{"nbt":"data.set_tags","entity":"@s"}] +tellraw @a ["set_cnt: ",{"score":{"name":"@s","objective":"set_cnt"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_ssnew.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_ssnew.mcfunction new file mode 100644 index 00000000..d75bc0bc --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_ssnew.mcfunction @@ -0,0 +1,4 @@ +#math:set/_ssnew +data modify storage math:io set set value [] +data modify storage math:io set_tags set value [] +scoreboard players set set_cnt int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_ssprint.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_ssprint.mcfunction new file mode 100644 index 00000000..4406f34a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_ssprint.mcfunction @@ -0,0 +1,6 @@ +#math:set/_ssprint + +tellraw @a "---set---" +tellraw @a ["set: ",{"nbt":"set","storage":"math:io"}] +tellraw @a ["set_tags: ",{"nbt":"set_tags","storage":"math:io"}] +tellraw @a ["set_cnt: ",{"score":{"name":"set_cnt","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_store.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_store.mcfunction new file mode 100644 index 00000000..af2f3248 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_store.mcfunction @@ -0,0 +1,4 @@ +#math:set/_store +data modify entity @s data.set set from storage math:io set +data modify entity @s data.set_tags set from storage math:io set_tags +scoreboard players operation @s set_cnt = set_cnt int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_subset.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_subset.mcfunction new file mode 100644 index 00000000..5a1c3d47 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_subset.mcfunction @@ -0,0 +1,16 @@ +#math:set/_subset +# 判断执行者是不是临时对象的子集 +# 输入实体对象,临时对象 +# 输出到 + +scoreboard players set res int 1 + +data modify storage math:io stemp_Tags set from entity @s Tags +data modify entity @s Tags set from storage math:io set_tags +scoreboard players operation sstemp0 int = set_cnt int + +data modify storage math:io stemp_tags set from entity @s data.set_tags +scoreboard players operation sloop int = @s set_cnt +execute if score sloop int matches 1.. run function math:set/subset_sloop + +data modify entity @s Tags set from storage math:io stemp_Tags \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/_swap.mcfunction b/mcfpp/math/src/math/data/math/functions/set/_swap.mcfunction new file mode 100644 index 00000000..199068a3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/_swap.mcfunction @@ -0,0 +1,10 @@ +#math:set/_swap +data modify storage math:io stemp set from entity @s data.set +data modify entity @s data.set set from storage math:io set +data modify storage math:io set set from storage math:io stemp + +data modify storage math:io stemp set from entity @s data.set_tags +data modify entity @s data.set_tags set from storage math:io set_tags +data modify storage math:io set_tags set from storage math:io stemp + +scoreboard players operation set_cnt int >< @s set_cnt \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/append_success.mcfunction b/mcfpp/math/src/math/data/math/functions/set/append_success.mcfunction new file mode 100644 index 00000000..801da030 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/append_success.mcfunction @@ -0,0 +1,3 @@ +#math:set/append_success +data modify storage math:io set append from storage math:io input +scoreboard players add set_cnt int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/cross_sloop.mcfunction b/mcfpp/math/src/math/data/math/functions/set/cross_sloop.mcfunction new file mode 100644 index 00000000..eca8082d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/cross_sloop.mcfunction @@ -0,0 +1,10 @@ +#math:set/cross_sloop +data modify entity @s Tags append from storage math:io stemp_tags[-1] +execute store result score sstemp1 int if data entity @s Tags[] +execute if score sstemp1 int = sstemp0 int run function math:set/cross_success +scoreboard players operation sstemp0 int = sstemp1 int +#循环迭代 +data remove storage math:io stemp[-1] +data remove storage math:io stemp_tags[-1] +scoreboard players remove sloop int 1 +execute if score sloop int matches 1.. run function math:set/cross_sloop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/cross_success.mcfunction b/mcfpp/math/src/math/data/math/functions/set/cross_success.mcfunction new file mode 100644 index 00000000..5bebaa80 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/cross_success.mcfunction @@ -0,0 +1,4 @@ +#math:set/cross_success +data modify storage math:io set append from storage math:io stemp[-1] +data modify storage math:io set_tags append from storage math:io stemp_tags[-1] +scoreboard players add set_cnt int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/diff_sloop.mcfunction b/mcfpp/math/src/math/data/math/functions/set/diff_sloop.mcfunction new file mode 100644 index 00000000..ddf1f9db --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/diff_sloop.mcfunction @@ -0,0 +1,9 @@ +#math:set/diff_sloop +data modify entity @s Tags append from storage math:io stemp_tags[-1] +execute store result score sstemp1 int if data entity @s Tags[] +execute if score sstemp1 int > sstemp0 int run function math:set/diff_success +#循环迭代 +data remove storage math:io stemp[-1] +data remove storage math:io stemp_tags[-1] +scoreboard players remove sloop int 1 +execute if score sloop int matches 1.. run function math:set/diff_sloop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/diff_success.mcfunction b/mcfpp/math/src/math/data/math/functions/set/diff_success.mcfunction new file mode 100644 index 00000000..f92043d8 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/diff_success.mcfunction @@ -0,0 +1,5 @@ +#math:set/diff_success +data modify storage math:io set append from storage math:io stemp[-1] +data modify storage math:io set_tags append from storage math:io stemp_tags[-1] +scoreboard players add set_cnt int 1 +scoreboard players operation sstemp0 int = sstemp1 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/init.mcfunction b/mcfpp/math/src/math/data/math/functions/set/init.mcfunction new file mode 100644 index 00000000..51f27fd7 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/init.mcfunction @@ -0,0 +1,7 @@ +#math:test/init + +scoreboard objectives add set_cnt dummy + +data modify storage math:io set set value [] +data modify storage math:io set_tags set value [] +scoreboard players set set_cnt int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/merge_sloop.mcfunction b/mcfpp/math/src/math/data/math/functions/set/merge_sloop.mcfunction new file mode 100644 index 00000000..7ec25bde --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/merge_sloop.mcfunction @@ -0,0 +1,9 @@ +#math:set/merge_sloop +data modify entity @s Tags append from storage math:io stemp_tags[-1] +execute store result score sstemp int if data entity @s Tags[] +execute if score sstemp int > set_cnt int run function math:set/merge_success +#循环迭代 +data remove storage math:io stemp[-1] +data remove storage math:io stemp_tags[-1] +scoreboard players remove sloop int 1 +execute if score sloop int matches 1.. run function math:set/merge_sloop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/merge_success.mcfunction b/mcfpp/math/src/math/data/math/functions/set/merge_success.mcfunction new file mode 100644 index 00000000..6e24eb44 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/merge_success.mcfunction @@ -0,0 +1,4 @@ +#math:set/merge_success +data modify storage math:io set append from storage math:io stemp[-1] +data modify storage math:io set_tags append from storage math:io stemp_tags[-1] +scoreboard players add set_cnt int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/set.mcfunction b/mcfpp/math/src/math/data/math/functions/set/set.mcfunction new file mode 100644 index 00000000..fc9a7c95 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/set.mcfunction @@ -0,0 +1,4 @@ +#math:set/set +execute store result score @s id run scoreboard players add #id id 1 +scoreboard players set @s set_cnt 0 +data modify entity @s Tags append from storage math:io input.tags[] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/subset_sloop.mcfunction b/mcfpp/math/src/math/data/math/functions/set/subset_sloop.mcfunction new file mode 100644 index 00000000..41222075 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/subset_sloop.mcfunction @@ -0,0 +1,8 @@ +#math:set/subset_sloop +data modify entity @s Tags append from storage math:io stemp_tags[-1] +execute store result score sstemp1 int if data entity @s Tags[] +execute if score sstemp1 int > sstemp0 int store success score sloop int run scoreboard players set res int 0 +#循环迭代 +data remove storage math:io stemp_tags[-1] +scoreboard players remove sloop int 1 +execute if score sloop int matches 1.. run function math:set/subset_sloop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/tags_sloop.mcfunction b/mcfpp/math/src/math/data/math/functions/set/tags_sloop.mcfunction new file mode 100644 index 00000000..30f2e432 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/tags_sloop.mcfunction @@ -0,0 +1,7 @@ +#math:set/tags_sloop +data modify block 29999984 0 8591 back_text.messages[0] set value '{"nbt":"stemp[-1]","storage":"math:io"}' +data modify storage math:io set_tags append from block 29999984 0 8591 back_text.messages[0] +#循环迭代 +data remove storage math:io stemp[-1] +scoreboard players remove sloop int 1 +execute if score sloop int matches 1.. run function math:set/tags_sloop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/test/base.mcfunction b/mcfpp/math/src/math/data/math/functions/set/test/base.mcfunction new file mode 100644 index 00000000..1a7f230a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/test/base.mcfunction @@ -0,0 +1,40 @@ +#math:set/test/base + +tellraw @a "---set_test_base---" +data modify storage math:io list set value ["hello","hello","world","im","a","a","cber"] +function math:list/_toset +data modify storage math:io input set value {tags:["A","test"]} +function math:set/_new +execute as @e[tag=result,limit=1] run function math:set/_store + +data modify storage math:io list set value ["hi","hi","cber","this","is","is","minecraft"] +function math:list/_toset +data modify storage math:io input set value {tags:["B","test"]} +function math:set/_new +execute as @e[tag=result,limit=1] run function math:set/_store + +execute as @e[tag=A,limit=1] run function math:set/_print +execute as @e[tag=B,limit=1] run function math:set/_print + +execute as @e[tag=A,limit=1] run function math:set/_get +data modify storage math:io input set value "8593" +function math:set/_append +execute as @e[tag=B,limit=1] run function math:set/_store +execute as @e[tag=B,limit=1] run function math:set/_print + +function math:set/_ssnew +data modify storage math:io input set value "8593" +function math:set/_append +data modify storage math:io input set value "3528" +function math:set/_append +execute as @e[tag=B,limit=1] run function math:set/_store +execute as @e[tag=B,limit=1] run function math:set/_print + +data modify storage math:io list set value ["no","name"] +function math:list/_toset +function math:set/_ssprint +execute as @e[tag=B,limit=1] run function math:set/_swap +execute as @e[tag=B,limit=1] run function math:set/_print +function math:set/_ssprint + +kill @e[tag=test] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/test/cross.mcfunction b/mcfpp/math/src/math/data/math/functions/set/test/cross.mcfunction new file mode 100644 index 00000000..12a0450b --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/test/cross.mcfunction @@ -0,0 +1,24 @@ +#math:set/test/cross + +data modify storage math:io input set value {tags:["test","set"]} +function math:set/_new +data modify storage math:io list set value ["hi","there","cber","name","minecraft"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_store + +data modify storage math:io list set value ["hi","hello","there","this"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_cross +function math:set/_ssprint + +data modify storage math:io list set value ["no","he","does"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_cross +function math:set/_ssprint + +data modify storage math:io list set value ["cber","is","name"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_cross +function math:set/_ssprint + +kill @e[tag=test] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/test/diff.mcfunction b/mcfpp/math/src/math/data/math/functions/set/test/diff.mcfunction new file mode 100644 index 00000000..f0dc7b98 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/test/diff.mcfunction @@ -0,0 +1,26 @@ +#math:set/test/diff + +tellraw @a "---set_test_diff---" + +data modify storage math:io input set value {tags:["test","set"]} +function math:set/_new +data modify storage math:io list set value ["hi","this","is"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_store + +data modify storage math:io list set value ["hi","minecraft","is","me"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_diff +function math:set/_ssprint + +data modify storage math:io list set value ["hi","this","is","minecraft"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_diff +function math:set/_ssprint + +data modify storage math:io list set value ["no","minecraft"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_diff +function math:set/_ssprint + +kill @e[tag=test] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/test/ex-tags.mcfunction b/mcfpp/math/src/math/data/math/functions/set/test/ex-tags.mcfunction new file mode 100644 index 00000000..2908e1c3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/test/ex-tags.mcfunction @@ -0,0 +1,15 @@ +#math:set/test/ex-tags + +tellraw @a "---set_test_ex-tags---" + +function math:set/_ssnew +data modify storage math:io set set value ["hi","test"] +execute store result score set_cnt int if data storage math:io set[] +function math:set/_ex-tags + +data modify storage math:io input set value {tags:["test","set"]} +function math:set/_new +execute as @e[tag=set,limit=1] run function math:set/_store +execute as @e[tag=set,limit=1] run function math:set/_print + +kill @e[tag=test] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/test/merge.mcfunction b/mcfpp/math/src/math/data/math/functions/set/test/merge.mcfunction new file mode 100644 index 00000000..2fa00501 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/test/merge.mcfunction @@ -0,0 +1,26 @@ +#math:set/test/merge + +tellraw @a "---set_test_merge---" + +data modify storage math:io input set value {tags:["test","set"]} +function math:set/_new +data modify storage math:io list set value ["hi","this","is"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_store + +data modify storage math:io list set value ["hi","minecraft","is","me"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_merge +function math:set/_ssprint + +data modify storage math:io list set value ["hi","this","is","minecraft"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_merge +function math:set/_ssprint + +data modify storage math:io list set value ["no","minecraft"] +function math:list/_toset +execute as @e[tag=set,limit=1] run function math:set/_merge +function math:set/_ssprint + +kill @e[tag=test] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/test/of.mcfunction b/mcfpp/math/src/math/data/math/functions/set/test/of.mcfunction new file mode 100644 index 00000000..2a82782a --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/test/of.mcfunction @@ -0,0 +1,14 @@ +#math:set/test/of + +tellraw @a "---set_test_of---" + +data modify storage math:io list set value ["hello","cber","hi","im","world"] +function math:list/_toset + +data modify storage math:io input set value "hi" +function math:set/_of +tellraw @a ["res: ",{"score":{"name":"res","objective":"int"}}] + +data modify storage math:io input set value "no" +function math:set/_of +tellraw @a ["res: ",{"score":{"name":"res","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/set/test/subset.mcfunction b/mcfpp/math/src/math/data/math/functions/set/test/subset.mcfunction new file mode 100644 index 00000000..e505a7f3 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/set/test/subset.mcfunction @@ -0,0 +1,28 @@ +#math:set/test/subset + +tellraw @a "---set_test_subset---" + +data modify storage math:io input set value {tags:["test","set","A"]} +function math:set/_new +data modify storage math:io input set value {tags:["test","set","B"]} +function math:set/_new + +data modify storage math:io list set value ["hi","hello","there","this","minecraft"] +function math:list/_toset +execute as @e[tag=A,limit=1] run function math:set/_store + +data modify storage math:io list set value ["hi","there","this"] +function math:list/_toset +execute as @e[tag=B,limit=1] run function math:set/_store +execute as @e[tag=A,limit=1] run function math:set/_get +execute as @e[tag=B,limit=1] run function math:set/_subset +tellraw @a ["res: ",{"score":{"name":"res","objective":"int"}}] + +data modify storage math:io list set value ["hi","there","this","no"] +function math:list/_toset +execute as @e[tag=B,limit=1] run function math:set/_store +execute as @e[tag=A,limit=1] run function math:set/_get +execute as @e[tag=B,limit=1] run function math:set/_subset +tellraw @a ["res: ",{"score":{"name":"res","objective":"int"}}] + +kill @e[tag=test] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/_3self.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/_3self.mcfunction new file mode 100644 index 00000000..001177df --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/_3self.mcfunction @@ -0,0 +1,4 @@ +#math:sqrt/_3self +scoreboard players set sstemp3 int 1 +execute if score sqrt int matches ..10000 run function math:sqrt/range8 +execute if score sqrt int matches 10001.. if score sstemp3 int matches 1 run function math:sqrt/range9 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/_3sqrt.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/_3sqrt.mcfunction new file mode 100644 index 00000000..af97ad11 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/_3sqrt.mcfunction @@ -0,0 +1,3 @@ +#math:sqrt/_3sqrt +execute if score inp int matches ..10000 run function math:sqrt/range3 +execute if score inp int matches 10001.. run function math:sqrt/range4 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/_self.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/_self.mcfunction new file mode 100644 index 00000000..d11735a7 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/_self.mcfunction @@ -0,0 +1,17 @@ +#math:sqrt/_self +execute store result score stemp0 int store result score stemp1 int store result score stemp2 int run scoreboard players operation stemp3 int = sqrt int +execute if score sqrt int matches ..13924 run function math:sqrt/range5 +execute if score sqrt int matches 13925..16777216 run function math:sqrt/range6 +execute if score sqrt int matches 16777217.. run function math:sqrt/range7 +scoreboard players operation stemp0 int /= sqrt int +scoreboard players operation sqrt int += stemp0 int +scoreboard players operation sqrt int /= 2 int +scoreboard players operation stemp1 int /= sqrt int +scoreboard players operation sqrt int += stemp1 int +scoreboard players operation sqrt int /= 2 int +scoreboard players operation stemp2 int /= sqrt int +scoreboard players operation sqrt int += stemp2 int +scoreboard players operation sqrt int /= 2 int +scoreboard players operation stemp3 int /= sqrt int +scoreboard players operation sqrt int += stemp3 int +scoreboard players operation sqrt int /= 2 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range0.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range0.mcfunction new file mode 100644 index 00000000..0d8bc698 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range0.mcfunction @@ -0,0 +1,4 @@ +#math:sqrt/range0 +scoreboard players remove res int 1 +scoreboard players operation res int /= 119 int +scoreboard players add res int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range1.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range1.mcfunction new file mode 100644 index 00000000..2c9c3df6 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range1.mcfunction @@ -0,0 +1,4 @@ +#math:sqrt/range1 +scoreboard players remove res int 13924 +scoreboard players operation res int /= 4214 int +scoreboard players add res int 118 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range2.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range2.mcfunction new file mode 100644 index 00000000..95f1f0ed --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range2.mcfunction @@ -0,0 +1,4 @@ +#math:sqrt/range2 +scoreboard players remove res int 16777216 +scoreboard players operation res int /= 50436 int +scoreboard players add res int 4096 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range3.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range3.mcfunction new file mode 100644 index 00000000..2fe12b59 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range3.mcfunction @@ -0,0 +1,25 @@ +#math:sqrt/range3 +scoreboard players operation sstemp int = inp int + +scoreboard players operation inp int *= 10000 int +function math:_sqrt +execute store result score sstemp1 int run scoreboard players operation sstemp0 int = res int +scoreboard players operation sstemp1 int *= sstemp0 int +execute if score sstemp1 int > inp int run function math:sqrt/rmv +scoreboard players operation sstemp2 int = sstemp0 int +scoreboard players operation sstemp2 int *= 2 int +scoreboard players add sstemp2 int 1 + +scoreboard players operation sstemp0 int *= 10 int +scoreboard players operation res int = inp int +scoreboard players operation res int -= sstemp1 int +scoreboard players operation sstemp3 int = res int +scoreboard players operation res int /= sstemp2 int +scoreboard players operation sstemp3 int %= sstemp2 int +scoreboard players operation res int *= 10 int +scoreboard players operation sstemp3 int *= 10 int +scoreboard players operation sstemp3 int /= sstemp2 int +scoreboard players operation res int += sstemp3 int +scoreboard players operation res int += sstemp0 int + +scoreboard players operation inp int = sstemp int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range4.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range4.mcfunction new file mode 100644 index 00000000..52859ba0 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range4.mcfunction @@ -0,0 +1,20 @@ +#math:sqrt/range4 +function math:_sqrt +execute store result score sstemp1 int run scoreboard players operation sstemp0 int = res int +scoreboard players operation sstemp1 int *= sstemp0 int +execute if score sstemp1 int > inp int run function math:sqrt/rmv +scoreboard players operation sstemp2 int = sstemp0 int +scoreboard players operation sstemp2 int *= 2 int +scoreboard players add sstemp2 int 1 + +scoreboard players operation sstemp0 int *= 1000 int +scoreboard players operation res int = inp int +scoreboard players operation res int -= sstemp1 int +scoreboard players operation sstemp3 int = res int +scoreboard players operation res int /= sstemp2 int +scoreboard players operation sstemp3 int %= sstemp2 int +scoreboard players operation res int *= 1000 int +scoreboard players operation sstemp3 int *= 1000 int +scoreboard players operation sstemp3 int /= sstemp2 int +scoreboard players operation res int += sstemp3 int +scoreboard players operation res int += sstemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range5.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range5.mcfunction new file mode 100644 index 00000000..e51a72a4 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range5.mcfunction @@ -0,0 +1,4 @@ +#math:sqrt/range5 +scoreboard players remove sqrt int 1 +scoreboard players operation sqrt int /= 119 int +scoreboard players add sqrt int 1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range6.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range6.mcfunction new file mode 100644 index 00000000..523e181d --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range6.mcfunction @@ -0,0 +1,4 @@ +#math:sqrt/range6 +scoreboard players remove sqrt int 13924 +scoreboard players operation sqrt int /= 4214 int +scoreboard players add sqrt int 118 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range7.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range7.mcfunction new file mode 100644 index 00000000..956f08bf --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range7.mcfunction @@ -0,0 +1,4 @@ +#math:sqrt/range7 +scoreboard players remove sqrt int 16777216 +scoreboard players operation sqrt int /= 50436 int +scoreboard players add sqrt int 4096 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range8.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range8.mcfunction new file mode 100644 index 00000000..2d78fd12 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range8.mcfunction @@ -0,0 +1,24 @@ +#math:sqrt/range3 +scoreboard players operation sqrt int *= 10000 int +scoreboard players operation sstemp int = sqrt int +function math:sqrt/_self +execute store result score sstemp1 int run scoreboard players operation sstemp0 int = sqrt int +scoreboard players operation sstemp1 int *= sstemp0 int +execute if score sstemp1 int > sstemp int run function math:sqrt/rmv +scoreboard players operation sstemp2 int = sstemp0 int +scoreboard players operation sstemp2 int *= 2 int +scoreboard players add sstemp2 int 1 + +scoreboard players operation sstemp0 int *= 10 int +scoreboard players operation sqrt int = sstemp int +scoreboard players operation sqrt int -= sstemp1 int +scoreboard players operation sstemp3 int = sqrt int +scoreboard players operation sqrt int /= sstemp2 int +scoreboard players operation sstemp3 int %= sstemp2 int +scoreboard players operation sqrt int *= 10 int +scoreboard players operation sstemp3 int *= 10 int +scoreboard players operation sstemp3 int /= sstemp2 int +scoreboard players operation sqrt int += sstemp3 int +scoreboard players operation sqrt int += sstemp0 int + +scoreboard players set sstemp3 int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/range9.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/range9.mcfunction new file mode 100644 index 00000000..02c00c76 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/range9.mcfunction @@ -0,0 +1,22 @@ +#math:sqrt/range4 +scoreboard players operation sstemp int = sqrt int + +function math:sqrt/_self +execute store result score sstemp1 int run scoreboard players operation sstemp0 int = sqrt int +scoreboard players operation sstemp1 int *= sstemp0 int +execute if score sstemp1 int > sstemp int run function math:sqrt/rmv +scoreboard players operation sstemp2 int = sstemp0 int +scoreboard players operation sstemp2 int *= 2 int +scoreboard players add sstemp2 int 1 + +scoreboard players operation sstemp0 int *= 1000 int +scoreboard players operation sqrt int = sstemp int +scoreboard players operation sqrt int -= sstemp1 int +scoreboard players operation sstemp3 int = sqrt int +scoreboard players operation sqrt int /= sstemp2 int +scoreboard players operation sstemp3 int %= sstemp2 int +scoreboard players operation sqrt int *= 1000 int +scoreboard players operation sstemp3 int *= 1000 int +scoreboard players operation sstemp3 int /= sstemp2 int +scoreboard players operation sqrt int += sstemp3 int +scoreboard players operation sqrt int += sstemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/sqrt/rmv.mcfunction b/mcfpp/math/src/math/data/math/functions/sqrt/rmv.mcfunction new file mode 100644 index 00000000..85dad187 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/sqrt/rmv.mcfunction @@ -0,0 +1,3 @@ +#math:sqrt/rmv +execute store result score sstemp1 int run scoreboard players remove sstemp0 int 1 +scoreboard players operation sstemp1 int *= sstemp0 int \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test.mcfunction b/mcfpp/math/src/math/data/math/functions/test.mcfunction new file mode 100644 index 00000000..fb8f8c27 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test.mcfunction @@ -0,0 +1,4 @@ +#math:test +summon item 0 11 0 {Tags:["uuid_marker"],Item:{id:"minecraft:glass",Count:1b},CustomName:'"origin_test"'} +execute as @e[tag=uuid_marker,limit=1] run function math:test/origin +kill @e[tag=uuid_marker,limit=1] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/_perf.mcfunction b/mcfpp/math/src/math/data/math/functions/test/_perf.mcfunction new file mode 100644 index 00000000..28552571 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/_perf.mcfunction @@ -0,0 +1,10 @@ +#math:test/_perf +worldborder set 1 0 + +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/_loop + +execute store result score res int run worldborder get +tellraw @a ["res: ",{"score":{"name":"res","objective":"int"}}] +worldborder set 50000000 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/_loop.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/_loop.mcfunction new file mode 100644 index 00000000..5ef776d1 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/_loop.mcfunction @@ -0,0 +1,5 @@ +#math:test/perf/_loop +scoreboard players operation temp int += 1 int +#循环迭代 +scoreboard players remove loop int 1 +execute if score loop int matches 1.. run function math:test/perf/_loop \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/_print.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/_print.mcfunction new file mode 100644 index 00000000..2785f705 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/_print.mcfunction @@ -0,0 +1,36 @@ +#math:test/perf/_print + +execute store result score sstemp int run scoreboard players operation perf_max int -= perf_avg int +scoreboard players operation perf_max int += perf_avg int +scoreboard players operation perf_avg int -= perf_min int +scoreboard players operation sstemp int > perf_avg int +scoreboard players operation perf_avg int += perf_min int +scoreboard players operation sstemp int *= 100 int +scoreboard players operation sstemp int /= perf_avg int + +tellraw @a "---perf_test_result---" +tellraw @a ["perf_n: ",{"score":{"name":"perf_n","objective":"int"}}] +tellraw @a ["min: ",{"score":{"name":"perf_min","objective":"int"}}," max: ",{"score":{"name":"perf_max","objective":"int"}}] +tellraw @a ["avg: ",{"score":{"name":"perf_avg","objective":"int"}}," err: ",{"score":{"name":"sstemp","objective":"int"}},"%"] + +scoreboard players operation sstemp int = perf_line_avg int +scoreboard players operation sstemp int -= perf_base_avg int +scoreboard players operation sstemp0 int = perf_avg int +scoreboard players operation sstemp0 int -= perf_base_avg int +scoreboard players operation sstemp1 int = sstemp0 int +scoreboard players operation sstemp0 int /= sstemp int +scoreboard players operation sstemp1 int %= sstemp int +scoreboard players operation sstemp1 int *= 100 int +scoreboard players operation sstemp1 int /= sstemp int +data modify block 29999984 0 8591 back_text.messages[0] set value '["scb: ",{"score":{"name":"sstemp0","objective":"int"}},".",{"score":{"name":"sstemp1","objective":"int"}}]' + +scoreboard players operation sstemp int = perf_line_mult_avg int +scoreboard players operation sstemp int -= perf_base_avg int +scoreboard players operation sstemp0 int = perf_avg int +scoreboard players operation sstemp0 int -= perf_base_avg int +scoreboard players operation sstemp1 int = sstemp0 int +scoreboard players operation sstemp0 int /= sstemp int +scoreboard players operation sstemp1 int %= sstemp int +scoreboard players operation sstemp1 int *= 100 int +scoreboard players operation sstemp1 int /= sstemp int +tellraw @a [{"nbt":"back_text.messages[0]","block":"29999984 0 8591","interpret":true}," scb_mult: ",{"score":{"name":"sstemp0","objective":"int"}},".",{"score":{"name":"sstemp1","objective":"int"}}] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/_ssnew.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/_ssnew.mcfunction new file mode 100644 index 00000000..b45a3399 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/_ssnew.mcfunction @@ -0,0 +1,34 @@ +#math:test/perf/_ssnew +gamerule maxCommandChainLength 2147483647 +scoreboard players set perf_n int 1000000 + +scoreboard players set temp int 8593 + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/std_loop0 +execute store result score perf_base int run worldborder get +scoreboard players operation perf_base_avg int = perf_base int +scoreboard players operation perf_base_min int = perf_base int +scoreboard players operation perf_base_max int = perf_base int + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/std_loop1 +execute store result score perf_line int run worldborder get +scoreboard players operation perf_line_avg int = perf_line int +scoreboard players operation perf_line_min int = perf_line int +scoreboard players operation perf_line_max int = perf_line int + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/std_loop2 +execute store result score perf_line_mult int run worldborder get +scoreboard players operation perf_line_mult_avg int = perf_line_mult int +scoreboard players operation perf_line_mult_min int = perf_line_mult int +scoreboard players operation perf_line_mult_max int = perf_line_mult int + +worldborder set 50000000 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/_ssprint.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/_ssprint.mcfunction new file mode 100644 index 00000000..ce3dac1c --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/_ssprint.mcfunction @@ -0,0 +1,31 @@ +#math:test/perf/_ssprint +tellraw @a "---perf_test---" + +tellraw @a ["perf_n: ",{"score":{"name":"perf_n","objective":"int"}}] + +execute store result score sstemp int run scoreboard players operation perf_base_max int -= perf_base_avg int +scoreboard players operation perf_base_max int += perf_base_avg int +scoreboard players operation perf_base_avg int -= perf_base_min int +scoreboard players operation sstemp int > perf_base_avg int +scoreboard players operation perf_base_avg int += perf_base_min int +scoreboard players operation sstemp int *= 100 int +scoreboard players operation sstemp int /= perf_base_avg int +tellraw @a ["base: {avg:",{"score":{"name":"perf_base_avg","objective":"int"}},{"text":", min:"},{"score":{"name":"perf_base_min","objective":"int"}},{"text":", max:"},{"score":{"name":"perf_base_max","objective":"int"}},{"text":", err:"},{"score":{"name":"sstemp","objective":"int"}},"%}"] + +execute store result score sstemp int run scoreboard players operation perf_line_max int -= perf_line_avg int +scoreboard players operation perf_line_max int += perf_line_avg int +scoreboard players operation perf_line_avg int -= perf_line_min int +scoreboard players operation sstemp int > perf_line_avg int +scoreboard players operation perf_line_avg int += perf_line_min int +scoreboard players operation sstemp int *= 100 int +scoreboard players operation sstemp int /= perf_line_avg int +tellraw @a ["line: {avg:",{"score":{"name":"perf_line_avg","objective":"int"}},{"text":", min:"},{"score":{"name":"perf_line_min","objective":"int"}},{"text":", max:"},{"score":{"name":"perf_line_max","objective":"int"}},{"text":", err:"},{"score":{"name":"sstemp","objective":"int"}},"%}"] + +execute store result score sstemp int run scoreboard players operation perf_line_mult_max int -= perf_line_mult_avg int +scoreboard players operation perf_line_mult_max int += perf_line_mult_avg int +scoreboard players operation perf_line_mult_avg int -= perf_line_mult_min int +scoreboard players operation sstemp int > perf_line_mult_avg int +scoreboard players operation perf_line_mult_avg int += perf_line_mult_min int +scoreboard players operation sstemp int *= 100 int +scoreboard players operation sstemp int /= perf_line_mult_avg int +tellraw @a ["line_mult: {avg:",{"score":{"name":"perf_line_mult_avg","objective":"int"}},{"text":", min:"},{"score":{"name":"perf_line_mult_min","objective":"int"}},{"text":", max:"},{"score":{"name":"perf_line_mult_max","objective":"int"}},{"text":", err:"},{"score":{"name":"sstemp","objective":"int"}},"%}"] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/_start.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/_start.mcfunction new file mode 100644 index 00000000..934e8dd1 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/_start.mcfunction @@ -0,0 +1,12 @@ +#math:test/perf/_start + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/_loop +execute store result score res int run worldborder get +scoreboard players operation perf_avg int = res int +scoreboard players operation perf_min int = res int +scoreboard players operation perf_max int = res int + +worldborder set 50000000 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/_std.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/_std.mcfunction new file mode 100644 index 00000000..d0cf9148 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/_std.mcfunction @@ -0,0 +1,33 @@ +#math:test/perf/_std + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/std_loop0 +execute store result score perf_base int run worldborder get +scoreboard players operation perf_base_avg int += perf_base int +scoreboard players operation perf_base_avg int /= 2 int +scoreboard players operation perf_base_min int < perf_base int +scoreboard players operation perf_base_max int > perf_base int + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/std_loop1 +execute store result score perf_line int run worldborder get +scoreboard players operation perf_line_avg int += perf_line int +scoreboard players operation perf_line_avg int /= 2 int +scoreboard players operation perf_line_min int < perf_line int +scoreboard players operation perf_line_max int > perf_line int + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/std_loop2 +execute store result score perf_line_mult int run worldborder get +scoreboard players operation perf_line_mult_avg int += perf_line_mult int +scoreboard players operation perf_line_mult_avg int /= 2 int +scoreboard players operation perf_line_mult_min int < perf_line_mult int +scoreboard players operation perf_line_mult_max int > perf_line_mult int + +worldborder set 50000000 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/_tick.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/_tick.mcfunction new file mode 100644 index 00000000..cb849f05 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/_tick.mcfunction @@ -0,0 +1,13 @@ +#math:test/perf/_tick + +worldborder set 1 0 +worldborder set 50000000 50000 +scoreboard players operation loop int = perf_n int +execute if score loop int matches 1.. run function math:test/perf/_loop +execute store result score res int run worldborder get +scoreboard players operation perf_avg int += res int +scoreboard players operation perf_avg int /= 2 int +scoreboard players operation perf_min int < res int +scoreboard players operation perf_max int > res int + +worldborder set 50000000 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/doc.txt b/mcfpp/math/src/math/data/math/functions/test/perf/doc.txt new file mode 100644 index 00000000..d5d5d4d0 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/doc.txt @@ -0,0 +1,8 @@ +execute store result score sstemp int run scoreboard players operation perf_line_mult_max int -= perf_line_mult_avg int +scoreboard players operation perf_line_mult_max int += perf_line_mult_avg int +scoreboard players operation perf_line_mult_avg int -= perf_line_mult_min int +scoreboard players operation sstemp int > perf_line_mult_avg int +scoreboard players operation perf_line_mult_avg int += perf_line_mult_min int +scoreboard players operation sstemp int *= 100 int +scoreboard players operation sstemp int /= perf_line_mult_avg int +tellraw @a ["line_mult: {avg:",{"score":{"name":"perf_line_mult_avg","objective":"int"}},{"text":", min:"},{"score":{"name":"perf_line_mult_min","objective":"int"}},{"text":", max:"},{"score":{"name":"perf_line_mult_max","objective":"int"}},{"text":", max_err:"},{"score":{"name":"sstemp","objective":"int"}},"%}"] \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/std_loop0.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/std_loop0.mcfunction new file mode 100644 index 00000000..59e09a01 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/std_loop0.mcfunction @@ -0,0 +1,4 @@ +#math:test/perf/std_loop0 +#循环迭代 +scoreboard players remove loop int 1 +execute if score loop int matches 1.. run function math:test/perf/std_loop0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/std_loop1.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/std_loop1.mcfunction new file mode 100644 index 00000000..4cbbe405 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/std_loop1.mcfunction @@ -0,0 +1,5 @@ +#math:test/perf/std_loop1 +scoreboard players operation temp int += 10000 int +#循环迭代 +scoreboard players remove loop int 1 +execute if score loop int matches 1.. run function math:test/perf/std_loop1 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/perf/std_loop2.mcfunction b/mcfpp/math/src/math/data/math/functions/test/perf/std_loop2.mcfunction new file mode 100644 index 00000000..88260bd4 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/perf/std_loop2.mcfunction @@ -0,0 +1,5 @@ +#math:test/perf/std_loop2 +scoreboard players operation temp int *= 10000 int +#循环迭代 +scoreboard players remove loop int 1 +execute if score loop int matches 1.. run function math:test/perf/std_loop2 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/test/run.mcfunction b/mcfpp/math/src/math/data/math/functions/test/run.mcfunction new file mode 100644 index 00000000..9b2c8136 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/test/run.mcfunction @@ -0,0 +1,6 @@ +#math:test/run +kill @e[tag=test] +summon item_display ~ ~ ~ {item:{id:"minecraft:grass",Count:1b},Tags:["test"]} +data merge entity @e[tag=test,limit=1] {transformation:{scale:[5.25f,5.25f,5.25f],translation:[-2.0f,0.0f,0.0f]},start_interpolation:0,interpolation_duration:20} + +scoreboard players set test int 0 \ No newline at end of file diff --git a/mcfpp/math/src/math/data/math/functions/tick.mcfunction b/mcfpp/math/src/math/data/math/functions/tick.mcfunction new file mode 100644 index 00000000..52a79e36 --- /dev/null +++ b/mcfpp/math/src/math/data/math/functions/tick.mcfunction @@ -0,0 +1,6 @@ +scoreboard players add upd_aec int 1 +execute as @e[tag=upd_aec,type=minecraft:area_effect_cloud] store result entity @s Air short 1 run scoreboard players operation upd_aec int %= 10 int + +data modify entity 0-0-0-8593-1 Age set value 0 + +schedule function math:tick 1t replace \ No newline at end of file diff --git a/mcfpp/math/src/math/pack.mcmeta b/mcfpp/math/src/math/pack.mcmeta new file mode 100644 index 00000000..57c2978c --- /dev/null +++ b/mcfpp/math/src/math/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 9, + "description": "by-xiaodou123" + } +} diff --git a/mcfpp/sys/.mclib b/mcfpp/sys/.mclib new file mode 100644 index 00000000..b192f25c --- /dev/null +++ b/mcfpp/sys/.mclib @@ -0,0 +1,122 @@ +{ + "namespaces":[ + { + "id":"mcfpp.sys", + "functions":[ + { + "id":"print", + "dataClass":"top.mcfpp.lang.System", + "javaMethodName":"print", + "normalParams":[ + { + "id":"i", + "type":"int", + "isStatic":false + } + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"print", + "dataClass":"top.mcfpp.lang.System", + "javaMethodName":"print", + "normalParams":[ + { + "id":"a", + "type":"any", + "isStatic":false + } + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"insert", + "dataClass":"top.mcfpp.lang.System", + "javaMethodName":"insert", + "normalParams":[ + { + "id":"i", + "type":"string", + "isStatic":false + } + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ], + "classes":[ + + ], + "template":[ + + ] + }, + { + "id":"default", + "functions":[ + + ], + "classes":[ + + ], + "template":[ + + ] + }, + { + "id":"mcfpp", + "functions":[ + { + "id":"load", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"tick", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + }, + { + "id":"init", + "normalParams":[ + + ], + "returnType":"void", + "isAbstract":false, + "tags":[ + + ] + } + ], + "classes":[ + + ], + "template":[ + + ] + } + ] +} \ No newline at end of file diff --git a/mcfpp/sys/mcfpp.sys.json b/mcfpp/sys/mcfpp.sys.json new file mode 100644 index 00000000..eca9f209 --- /dev/null +++ b/mcfpp/sys/mcfpp.sys.json @@ -0,0 +1,9 @@ +{ + "files": [ + "*" + ], + "description": "", + "namespace": "mcfpp.sys", + "targetPath": "null", + "ignoreStdLib": true +} \ No newline at end of file diff --git a/mcfpp/sys/sys.mcfpp b/mcfpp/sys/sys.mcfpp new file mode 100644 index 00000000..9d077a02 --- /dev/null +++ b/mcfpp/sys/sys.mcfpp @@ -0,0 +1,3 @@ +func print(int i) = top.mcfpp.lang.System.print; +func print(any a) = top.mcfpp.lang.System.print; +func insert(string i) = top.mcfpp.lang.System.insert; \ No newline at end of file diff --git a/src/main/antlr/mcfpp.g4 b/src/main/antlr/mcfpp.g4 deleted file mode 100644 index 1921addb..00000000 --- a/src/main/antlr/mcfpp.g4 +++ /dev/null @@ -1,433 +0,0 @@ -grammar mcfpp; - -//一个mcfpp文件 -compilationUnit - : namespaceDeclaration? - typeDeclaration * - EOF - ; - -//命名空间声明 -namespaceDeclaration - : 'namespace' Identifier ';' - ; - -//类或函数声明 -typeDeclaration - : classOrFunctionDeclaration - ; - -//类或函数声明 -classOrFunctionDeclaration - : classDeclaration - | functionDeclaration - | nativeFuncDeclaration - | nativeClassDeclaration - ; - -//类声明 -classDeclaration - : STATIC? FINAL? 'class' className (EXTENDS className)? classBody - ; - -nativeClassDeclaration - : NATIVE 'class' className '->' javaRefer ';' - ; - - -classBody - : '{' (classMemberDeclaration|staticClassMemberDeclaration)* '}' - ; - -staticClassMemberDeclaration - : accessModifier? STATIC classMember - ; - -classMemberDeclaration - : accessModifier? classMember - ; - -//类成员 -classMember - : classFunctionDeclaration - | fieldDeclaration ';' - | constructorDeclaration - | nativeFuncDeclaration - | nativeConstructorDeclaration - ; - -classFunctionDeclaration - : 'func' Identifier '(' parameterList? ')' '{' functionBody '}' - ; - -//函数声明 -functionDeclaration - : INLINE? functionTag? 'func' namespaceID '(' parameterList? ')' '{' functionBody '}' - ; - -namespaceID - : (Identifier ':')? Identifier - ; - -nativeFuncDeclaration - : accessModifier? NATIVE 'func' Identifier '(' parameterList? ')' '->' javaRefer ';' - ; - -javaRefer - : stringName ('.' stringName)* - ; - -stringName - : Identifier - | ClassIdentifier - | NORMALSTRING - ; - -accessModifier - : PRIVATE - | PROTECTED - | PUBLIC - ; - -//构造函数声明 -constructorDeclaration - : className '(' parameterList? ')' '{' functionBody '}' - ; - -//构造函数声明 -nativeConstructorDeclaration - : accessModifier? NATIVE? className '(' parameterList? ')' '->' javaRefer ';' - ; - -//构造函数的调用 -constructorCall - : 'new' className arguments - ; - -//变量声明 -fieldDeclaration - : CONST? type Identifier - | CONST? type Identifier '=' expression - ; - -//参数列表 -parameterList - : parameter (',' parameter)* - ; - -//参数 -parameter - : STATIC? CONCRETE? type Identifier - ; - -//表达式 -expression - : conditionalOrExpression - ; - -//能作为语句的表达式 -statementExpression - : basicExpression '=' expression - ; - -//条件表达式 -conditionalExpression - : conditionalOrExpression ( '?' expression ':' expression )? - ; - -//或门 -conditionalOrExpression - : conditionalAndExpression ( '||' conditionalAndExpression )* - ; - -//与门 -conditionalAndExpression - : equalityExpression ( '&&' equalityExpression )* - ; - -//等同 -equalityExpression - : relationalExpression ( op=('==' | '!=') relationalExpression )* - ; - -//比较关系 -relationalExpression - : additiveExpression ( relationalOp additiveExpression )? - ; - -//比较关系运算符 -relationalOp - : '<=' - | '>=' - | '<' - | '>' - ; - -//加减 -additiveExpression - : multiplicativeExpression ( op=('+' | '-') multiplicativeExpression )* - ; - -//乘除 -multiplicativeExpression - : unaryExpression ( op=( '*' | '/' | '%' ) unaryExpression )* - ; - -//一元表达式 -unaryExpression - : '!' unaryExpression - | castExpression - | basicExpression - ; - -basicExpression - : primary - | varWithSelector - ; - -//强制类型转换表达式 -castExpression - : '(' type ')' unaryExpression - ; - -//初级表达式 -primary - : var - | value - ; - -varWithSelector - : var selector* - | className selector+ - ; - -var - : '(' expression ')' - | Identifier identifierSuffix* - | THIS - | SUPER - | constructorCall - | TargetSelector - ; - -identifierSuffix - : '[' conditionalExpression ']' - ; - -selector - : '.' var - ; - -arguments - : '(' expressionList? ')' - ; - -functionBody - : statement* - ; - -functionCall - : namespaceID arguments - | 'this' arguments - | 'super' arguments - | basicExpression arguments - ; - -statement - : fieldDeclaration ';' - | statementExpression ';' - | functionCall ';' - | ifStatement - | forStatement - | whileStatement - | doWhileStatement ';' - | ';' - | selfAddOrMinusStatement ';' - | tryStoreStatement - | controlStatement ';' - | orgCommand - ; - -orgCommand - : OrgCommand - ; - -OrgCommand - : '/' [a-z]* ([ ][a-z:_{}\\[0-9A-Z\]]*)+ - ; - -controlStatement - : BREAK - | CONTINUE - ; - -ifStatement - : IF'('expression')' ifBlock (ELSE (elseIfStatement|ifBlock))? - ; - -elseIfStatement - : ifStatement - ; - -ifBlock - : block - ; - -forStatement - : FOR '(' forControl ')' forBlock - ; - -forBlock - : block - ; - -forControl - : forInit* ';' expression? ';' forUpdate - ; - -forInit - : fieldDeclaration - | statementExpression - ; - -forUpdate - : statementExpression* - ; - -whileStatement - : WHILE '(' expression ')' whileBlock - ; - -whileBlock - : block - ; - -doWhileStatement - : DO doWhileBlock WHILE '(' expression ')' - ; - -doWhileBlock - : block - ; - -selfAddOrMinusStatement - : selfAddOrMinusExpression - ; - -tryStoreStatement - : TRY block STORE '(' Identifier ')' ';' - ; - -block - : '{' statement* '}' - ; - -selfAddOrMinusExpression - : Identifier op = ('++'|'--') - ; - -expressionList - : expression (',' expression)* - ; - -type - : 'int' - | 'bool' - | className - ; - -value - : INT - | DECIMAL - | STRING - ; - -className - : (Identifier ':')? ClassIdentifier - | (Identifier ':')? InsideClass - ; - -functionTag - : namespaceID - ; - -TargetSelector - : '@' ('a'|'r'|'p'|'s'|'e') - ; - -THIS:'this'; -SUPER:'super'; -IF:'if'; -ELSE:'else'; -WHILE:'while'; -FOR:'for'; -DO:'do'; -TRY:'try'; -STORE:'store'; - -BREAK:'break'; -CONTINUE:'continue'; - -STATIC:'static'; -EXTENDS:'extends'; -NATIVE:'native'; -CONCRETE:'concrete'; -FINAL:'final '; - -PUBLIC:'public'; -PROTECTED:'protected'; -PRIVATE:'private'; - -CONST:'const'; -INLINE:'inline'; - -InsideClass - : 'entity' - | 'selector' - | 'string' - | VEC INT - ; - -INT - : [1-9][0-9]*|[0] - ; - -DECIMAL - : INT - | INT '.' [0-9]+ - ; - -VEC:'vec'; - -WAVE:'~'; - -Identifier - : [a-z_][a-zA-Z0-9_]* - ; - -ClassIdentifier - : [A-Z][a-zA-Z0-9_]* - ; - -NORMALSTRING - : [A-Za-z0-9_]+ - ; - -STRING - : '"' .*? '"' - ; - -// -// Whitespace and comments -// - -WS : [ \t\r\n\u000C]+ -> skip - ; - -COMMENT - : '/*' .*? '*/' -> skip - ; - -LINE_COMMENT - : '//' ~[\r\n]* -> skip - ; \ No newline at end of file diff --git a/src/main/antlr/mcfppLexer.g4 b/src/main/antlr/mcfppLexer.g4 new file mode 100644 index 00000000..6e8135eb --- /dev/null +++ b/src/main/antlr/mcfppLexer.g4 @@ -0,0 +1,236 @@ +lexer grammar mcfppLexer; + +import unicodeClass; + +//Base Character Set +WAVE:'~'; +RESERVED: '...' ; +DOT: '.' ; +COMMA: ',' ; +LPAREN: '('; +RPAREN: ')'; +LSQUARE: '['; +RSQUARE: ']'; +LCURL: '{' -> pushMode(DEFAULT_MODE); +RCURL: '}' -> popMode; +MULT: '*' ; +MOD: '%' ; +DIV: '/' ; +ADD: '+' ; +SUB: '-' ; +INCR: '++' ; +DECR: '--' ; +CONJ: '&&' ; +DISJ: '||' ; +EXCL: '!'; +COLON: ':' ; +SEMICOLON: ';' ; +ASSIGNMENT: '=' ; +ADD_ASSIGNMENT: '+=' ; +SUB_ASSIGNMENT: '-=' ; +MULT_ASSIGNMENT: '*=' ; +DIV_ASSIGNMENT: '/=' ; +MOD_ASSIGNMENT: '%=' ; +ARROW: '->' ; +DOUBLE_ARROW: '=>' ; +RANGE: '..' ; +//COLONCOLON: '::' ; +//DOUBLE_SEMICOLON: ';;' ; +HASH: '#' ; +AT: '@' ; +QUEST: '?' ; +LANGLE: '<' ; +RANGLE: '>' ; +LE: '<=' ; +GE: '>=' ; +EXCL_EQ: '!=' ; +//EXCL_EQEQ: '!==' ; +EQEQ: '==' ; +//EQEQEQ: '===' ; +SINGLE_QUOTE: '\'' ; +//RIGHT_SHIFT_ARITHMETIC: '>>'; +//LEFT_SHIFT_ARITHMETIC: '<<'; +//RIGHT_SHIFT_LOGICAL: '>>>'; +//BIT_AND: '&'; +//BIT_X_OR: '^'; +//BIT_OR: '|'; +//LEFT_SHIFT_ARITHMETIC_ASSIGN: '<<='; +//RIGHT_SHIFT_ARITHMETIC_ASSIGN: '>>='; +//RIGHT_SHIFT_LOGICAL_ASSIGN: '>>>='; +//BIT_AND_ASSIGN: '&='; +//BIT_XOR_ASSIGN: '^='; +//BIT_OR_ASSIGN: '|='; +TRIPLE_QUOTE_OPEN: '"""' -> pushMode(MultiLineString) ; + +//KeyWords +THIS:'this'; +SUPER:'super'; +IF:'if'; +ELSE:'else'; +WHILE:'while'; +FOR:'for'; +DO:'do'; +TRY:'try'; +STORE:'store'; +AS:'as'; +FROM:'from'; + +BREAK:'break'; +CONTINUE:'continue'; +RETURN:'return'; + +STATIC:'static'; +EXTENDS:'extends'; +NATIVE:'native'; +CONCRETE:'concrete'; +FINAL:'final '; + +PUBLIC:'public'; +PROTECTED:'protected'; +PRIVATE:'private'; + +OVERRIDE: 'override'; +ABSTRACT: 'abstract'; + +CONST:'const'; +DYNAMIC:'dynamic'; +IMPORT: 'import'; + +INLINE:'inline'; + +CLASS:'class'; +INTERFACE:'interface'; +TEMPLATE:'template'; +FUNCTION:'func'; + +GLOBAL:'global'; +VAR:'var'; + +NAMESPACE: 'namespace'; +VEC: 'vec'; +INT: 'int'; +ENTITY: 'entity'; +BOOL: 'bool'; +FLOAT: 'float'; +SELECTOR: 'selector'; +STRING: 'string'; +JTEXT: 'jtext'; +NBT: 'nbt'; +ANY: 'any'; +TYPE: 'type'; +VOID: 'void'; +LIST: 'list'; +MAP: 'map'; +DICT: 'dict'; + +VecType: VEC DecimalConstant; + +//Identifiers +TargetSelector + : '@' ('a'|'r'|'p'|'s'|'e') + ; + +fragment DigitSequence: [0-9]+; +fragment HexSequence: [0-9a-fA-F]+; +fragment OctalSequence: [0-7]+; + +fragment DecimalConstant: DigitSequence; +fragment HexadecimalConstant: '0x' HexSequence; +fragment OctalConstant: '0' | '0' OctalSequence; +fragment FractionalConstant: DigitSequence DOT DigitSequence; + +fragment ExponentPart + : [e|E] (ADD|SUB)? DigitSequence; + +fragment IntConstant : DecimalConstant|HexadecimalConstant|OctalConstant; + + + +Identifier + : (Letter | '_') (Letter | '_' | UnicodeDigit)* + ; + +Letter + : UNICODE_CLASS_LU + | UNICODE_CLASS_LL + | UNICODE_CLASS_LT + | UNICODE_CLASS_LM + | UNICODE_CLASS_LO + ; + +fragment UnicodeDigit + : UNICODE_CLASS_ND + ; + +NBT_BYTE_ARRAY_BEGIN: '[B;'; +NBT_INT_ARRAY_BEGIN: '[I;'; +NBT_LONG_ARRAY_BEGIN: '[L;'; + +fragment NBTByteSuffix: [bB]; +fragment NBTShortSuffix: [sS]; +fragment NBTLongSuffix: [lL]; +fragment NBTFloatSuffix: [fF]; +fragment NBTDoubleSuffix: [dD]; + +NBTByte: IntConstant NBTByteSuffix; +NBTShort: IntConstant NBTShortSuffix; +//NBTInt: IntConstant; +NBTLong: IntConstant NBTLongSuffix; +//NBTFloat: FractionalConstant ExponentPart?; +NBTDouble: (DigitSequence|FractionalConstant) ExponentPart? NBTDoubleSuffix; + +IntegerConstant: IntConstant; + +FloatConstant + : DigitSequence NBTFloatSuffix + | FractionalConstant ExponentPart? NBTFloatSuffix? + ; + +BooleanConstant + : 'true' + | 'false' + ; + +LineString: ('"' .*? '"' )|( '\'' .*? '\'' ); + +OrgCommand + : '/' [a-z]* ([ ][a-z:._{}\\[0-9A-Z\]]*)+ + ; + +WS : [ \t\r\n\u000C]+ -> skip + ; + +DOC_COMMENT + : '#{' .*? '}#' + ; + +BLOCK_COMMENT + : '##' .*? '##' -> skip + ; + +LINE_COMMENT + : '#' ~[\r\n]* -> skip + ; + + + + +mode MultiLineString ; + +TRIPLE_QUOTE_CLOSE + : MultiLineStringQuote? '"""' -> popMode + ; + +MultiLineStringQuote + : '"'+ + ; + + +MultiLineStrExprStart + : '${' -> pushMode(DEFAULT_MODE) + ; + + +MultiLineStrText + : ~('"' | '$')+ | '$' + ; diff --git a/src/main/antlr/mcfppParser.g4 b/src/main/antlr/mcfppParser.g4 new file mode 100644 index 00000000..ff81fa61 --- /dev/null +++ b/src/main/antlr/mcfppParser.g4 @@ -0,0 +1,618 @@ +/* + [The "BSD licence"] + Copyright (c) 2016 Pascal Gruen + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +parser grammar mcfppParser; + +options { + tokenVocab = mcfppLexer; +} + +//TODO 类型别名和导入库文件的语句顺序不用这么严格 +//一个mcfpp文件 +compilationUnit + : namespaceDeclaration? + importDeclaration* + topStatement + typeDeclaration* + EOF + ; + +topStatement + : statement* + ; + +//命名空间声明 +namespaceDeclaration + : doc_comment? NAMESPACE Identifier (DOT Identifier)* ';' + ; + +importDeclaration + : IMPORT Identifier ('.' Identifier)* ('.' cls = (Identifier|'*'))? (AS Identifier)? (FROM Identifier)? ';' + ; + +//类或函数声明 +typeDeclaration + : doc_comment? declarations + ; + +//类或函数声明 +declarations + : classDeclaration + | functionDeclaration + | inlineFunctionDeclaration + | nativeFuncDeclaration + | compileTimeFuncDeclaration + | compileTimeClassDeclaration + | nativeClassDeclaration + | templateDeclaration + | extensionFunctionDeclaration + | interfaceDeclaration + | globalDeclaration + ; + +//全局声明 +globalDeclaration + : GLOBAL '{' (doc_comment? fieldDeclaration ';')* '}' + ; + +//类声明 +classDeclaration + : classAnnotation? STATIC? FINAL? ABSTRACT? CLASS classWithoutNamespace readOnlyParams? (COLON className (',' className)*)? classBody + ; + +compileTimeClassDeclaration + : CONST CLASS classWithoutNamespace (COLON className (',' className)*)? classBody + ; + +nativeClassDeclaration + : CLASS classWithoutNamespace '=' javaRefer ';' + ; + +staticClassMemberDeclaration + : accessModifier? STATIC classMember + ; + +classMemberDeclaration + : accessModifier? classMember + ; + +classBody + : '{' (doc_comment? (classMemberDeclaration|staticClassMemberDeclaration))* '}' + ; + +//类成员 +classMember + : classFunctionDeclaration + | classFieldDeclaration ';' + | constructorDeclaration + | nativeClassFunctionDeclaration + | abstractClassFunctionDeclaration + ; + +classFunctionDeclaration + : funcAnnoation? OVERRIDE? FUNCTION Identifier functionParams (ARROW functionReturnType)? '{' functionBody '}' + ; + +abstractClassFunctionDeclaration + : funcAnnoation? OVERRIDE? FUNCTION Identifier functionParams (ARROW functionReturnType)? ';' + ; + +nativeClassFunctionDeclaration + : funcAnnoation? OVERRIDE? FUNCTION Identifier functionParams (ARROW functionReturnType)? '=' javaRefer ';' + ; + +classFieldDeclaration + : accessModifier? type fieldDeclarationExpression + ; + +//数据模板 +templateDeclaration + : FINAL? type TEMPLATE classWithoutNamespace (EXTENDS className)? templateBody + ; + +templateBody + : '{' (doc_comment? (templateMemberDeclaration|staticTemplateMemberDeclaration))* '}' + ; + +templateMemberDeclaration + : accessModifier? templateMember + ; + +staticTemplateMemberDeclaration + : accessModifier? STATIC? templateMember + ; + +templateMember + : templateFunctionDeclaration + | templateFieldDeclaration ';' + ; + +templateFunctionDeclaration + : FUNCTION Identifier functionParams (ARROW functionReturnType)? '{' functionBody '}' + ; + +templateFieldDeclaration + : (templateFieldDeclarationExpression ',')* templateFieldDeclarationExpression ';' + ; + +templateFieldDeclarationExpression + : CONST? Identifier '=' expression + ; + + +//接口声明 +interfaceDeclaration + : classAnnotation? INTERFACE classWithoutNamespace (ARROW className (',' className)*)? interfaceBody + ; + +interfaceBody + : '{'( doc_comment? interfaceFunctionDeclaration )* '}' + ; + +interfaceFunctionDeclaration + : funcAnnoation? FUNCTION Identifier functionParams (ARROW functionReturnType)? ';' + ; + +compileTimeFuncDeclaration + : CONST FUNCTION Identifier functionParams (ARROW functionReturnType)? '{' functionBody '}' + ; + +inlineFunctionDeclaration + : funcAnnoation? INLINE FUNCTION Identifier functionParams (ARROW functionReturnType)? '{' functionBody '}' + ; + +//函数声明 +functionDeclaration + : funcAnnoation? FUNCTION Identifier functionParams (ARROW functionReturnType)? '{' functionBody '}' + ; + +extensionFunctionDeclaration + : funcAnnoation? STATIC? FUNCTION (type '.')? Identifier functionParams (ARROW functionReturnType)? '{' functionBody '}' + ; + +namespaceID + : (Identifier ( '.' Identifier)* ':')? Identifier + ; + +nativeFuncDeclaration + : funcAnnoation? FUNCTION Identifier functionParams (ARROW functionReturnType)? '=' javaRefer ';' + ; + +javaRefer + : Identifier ('.' Identifier)* + ; + +accessModifier + : PRIVATE + | PROTECTED + | PUBLIC + ; + +//构造函数声明 +constructorDeclaration + : funcAnnoation? className normalParams '{' functionBody '}' + ; + +//变量声明 +fieldDeclaration + : fieldModifier? type fieldDeclarationExpression (',' fieldDeclarationExpression)* + | fieldModifier? VAR Identifier '=' expression + ; + +fieldDeclarationExpression + : Identifier ( '=' expression)? + ; + +fieldModifier : CONST|DYNAMIC|IMPORT; + +functionParams + : readOnlyParams? normalParams + ; + +readOnlyParams + : '<' parameterList? '>' + ; + +normalParams + : '(' parameterList? ')' + ; + +//参数列表 +parameterList + : parameter (',' parameter)* + ; + +//参数 +parameter + : STATIC? type Identifier + ; + +//表达式 +expression + : primary + | conditionalOrExpression + ; + +//expression +// : conditionalOrExpression +// ; + +//能作为语句的表达式 +statementExpression + : (basicExpression '=' )? expression + ; + +//条件表达式 +conditionalExpression + : conditionalOrExpression ( '?' expression ':' expression )? + ; + +//或 +conditionalOrExpression + : conditionalAndExpression ( '||' conditionalAndExpression )* + ; + +//与 +conditionalAndExpression + : equalityExpression ( '&&' equalityExpression )* + ; + +//等同 +equalityExpression + : relationalExpression ( op=('==' | '!=') relationalExpression )? + ; + +//比较关系 +relationalExpression + : additiveExpression ( relationalOp additiveExpression )? + ; + +//比较关系运算符 +relationalOp + : '<=' + | '>=' + | '<' + | '>' + ; + +//加减 +additiveExpression + : multiplicativeExpression ( op=('+' | '-') multiplicativeExpression )* + ; + +//乘除 +multiplicativeExpression + : unaryExpression ( op=( '*' | '/' | '%' ) unaryExpression )* + ; + +//一元表达式 +unaryExpression + : '!' unaryExpression + | castExpression + | rightVarExpression + ; + +//右侧计算式取出的变量 +rightVarExpression + : basicExpression + ; + +//强制类型转换表达式 +castExpression + : '(' type ')' unaryExpression + ; + +basicExpression + : primary + | varWithSelector + ; +//初级表达式 +primary + : var + | value + | THIS + | SUPER + | TargetSelector + ; + +varWithSelector + : primary selector+ + | type selector+ + ; + +var + : '(' expression ')' + | Identifier identifierSuffix* + | namespaceID arguments + ; + +identifierSuffix + : '[' conditionalExpression ']' + ; + +selector + : '.' var + ; + +arguments + : readOnlyArgs? normalArgs + ; + +readOnlyArgs + : '<' expressionList? '>' + ; + +normalArgs + : '(' expressionList? ')' + ; + +functionBody + : statement* + ; + +//functionCall +// : namespaceID arguments +// | varWithSelector arguments +// ; + +statement + : fieldDeclaration ';' + | statementExpression ';' +// | functionCall ';' + | ifStatement + | forStatement + | whileStatement + | doWhileStatement ';' + | ';' + | selfAddOrMinusStatement ';' + | tryStoreStatement + | controlStatement ';' + | orgCommand + | returnStatement ';' + ; + +orgCommand + : OrgCommand + ; + + + +controlStatement + : BREAK + | CONTINUE + ; + +ifStatement + : IF'('expression')' ifBlock elseIfStatement* elseStatement? + ; + +elseIfStatement + : ELSE IF '('expression')' ifBlock + ; + +elseStatement + : ELSE ifBlock + ; + +ifBlock + : block + ; + +forStatement + : FOR '(' forControl ')' forBlock + ; + +forBlock + : block + ; + +forControl + : forInit ';' expression? ';' forUpdate + ; + +forInit + : (fieldDeclaration|statementExpression)? + | (fieldDeclaration|statementExpression) (',' (fieldDeclaration|statementExpression))+ + ; + +forUpdate + : statementExpression* + ; + +whileStatement + : WHILE '(' expression ')' whileBlock + ; + +whileBlock + : block + ; + +doWhileStatement + : DO doWhileBlock WHILE '(' expression ')' + ; + +doWhileBlock + : block + ; + +selfAddOrMinusStatement + : selfAddOrMinusExpression + ; + +tryStoreStatement + : TRY block STORE '(' Identifier ')' ';' + ; + +returnStatement + : RETURN expression? + ; + +block + : '{' statement* '}' + ; + +selfAddOrMinusExpression + : rightVarExpression op = ('++'|'--') + ; + +expressionList + : expression (',' expression)* + ; + +type + : normalType + | LIST '<' type '>' + | className readOnlyArgs? + | Identifier + ; + +normalType + : INT + | ENTITY + | BOOL + | FLOAT + | SELECTOR + | STRING + | JTEXT + | NBT + | TYPE + | ANY + | VecType //向量 + | MAP + | DICT + ; + +functionReturnType + : type + | VOID + ; + +value + : intValue + | floatValue + | LineString + | boolValue + | multiLineStringLiteral + | nbtValue + | range + | type + ; + +intValue + : IntegerConstant + ; + +floatValue + : FloatConstant + ; + +boolValue + : BooleanConstant + ; + +className + : (Identifier ('.' Identifier)* ':')? classWithoutNamespace + ; + +typeList + : '<' typeList? '>' + ; + +classWithoutNamespace + : Identifier + ; + +funcAnnoation + : '@' id=Identifier arguments? + ; +classAnnotation + : '@' id=Identifier arguments? + ; + +range + : num1=(IntegerConstant|FloatConstant) '..' num2=(IntegerConstant|FloatConstant) + | num1=(IntegerConstant|FloatConstant) '..' + | '..' num2=(IntegerConstant|FloatConstant) + ; + +namespacePath + : Identifier ':' Identifier ('/' Identifier)* + ; + + +nbtValue + : LineString + | nbtByte + | nbtShort + | nbtInt + | nbtLong + | nbtFloat + | nbtDouble + | nbtCompound + | nbtList + | nbtByteArray + | nbtIntArray + | nbtLongArray + ; + +nbtByte: NBTByte; +nbtShort: NBTShort; +nbtInt: IntegerConstant; +nbtLong: NBTLong; +nbtFloat: FloatConstant; +nbtDouble: NBTDouble; + +nbtByteArray: NBT_BYTE_ARRAY_BEGIN nbtByte (',' nbtByte)* ']'; +nbtIntArray: NBT_INT_ARRAY_BEGIN nbtInt (',' nbtInt)* ']'; +nbtLongArray: NBT_LONG_ARRAY_BEGIN nbtLong (',' nbtLong)* ']'; + +nbtList: '[' (nbtValue (',' nbtValue)* )* ']'; +nbtKeyValuePair: key=Identifier ':' nbtValue; +nbtCompound: '{'( nbtKeyValuePair (',' nbtKeyValuePair)* )*'}'; + +multiLineStringLiteral + : TRIPLE_QUOTE_OPEN multiLineStringContent * TRIPLE_QUOTE_CLOSE + ; + +multiLineStringContent + : multiLineStringExpression + | MultiLineStrText + | MultiLineStringQuote + ; + +multiLineStringExpression + : MultiLineStrExprStart expression '}' + ; +// +// Whitespace and comments +// + + +doc_comment + : DOC_COMMENT + ; diff --git a/src/main/antlr/mcfppdoc.g4 b/src/main/antlr/mcfppdoc.g4 new file mode 100644 index 00000000..b6e29c6f --- /dev/null +++ b/src/main/antlr/mcfppdoc.g4 @@ -0,0 +1,193 @@ +/* + [The "BSD licence"] + Copyright (c) 2016 Pascal Gruen + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +grammar mcfppdoc; + +documentation + : MCFPPDOC_START skipWhitespace* documentationContent MCFPPDOC_END + ; + +documentationContent + : description skipWhitespace* + | skipWhitespace* tagSection + | description NEWLINE+ skipWhitespace* tagSection + ; + +skipWhitespace + : SPACE + | NEWLINE + ; + +description + : descriptionLine (descriptionNewline+ descriptionLine)* + ; + +descriptionLine + : descriptionLineStart descriptionLineElement* + | inlineTag descriptionLineElement* + ; + +descriptionLineStart + : SPACE? descriptionLineNoSpaceNoAt+ (descriptionLineNoSpaceNoAt | SPACE | AT)* + ; + +descriptionLineNoSpaceNoAt + : TEXT_CONTENT + | NAME + | STAR + | SLASH + | BRACE_OPEN + | BRACE_CLOSE + ; + +descriptionLineElement + : inlineTag + | descriptionLineText + ; + +descriptionLineText + : (descriptionLineNoSpaceNoAt | SPACE | AT)+ + ; + +descriptionNewline + : NEWLINE + ; + + +tagSection + : blockTag+ + ; + +blockTag + : SPACE? AT blockTagName SPACE? blockTagContent* + ; + +blockTagName + : NAME + ; + +blockTagContent + : blockTagText + | inlineTag + | NEWLINE + ; + +blockTagText + : blockTagTextElement+ + ; + +blockTagTextElement + : TEXT_CONTENT + | NAME + | SPACE + | STAR + | SLASH + | BRACE_OPEN + | BRACE_CLOSE + ; + + +inlineTag + : INLINE_TAG_START inlineTagName SPACE* inlineTagContent? BRACE_CLOSE + ; + +inlineTagName + : NAME + ; + +inlineTagContent + : braceContent+ + ; + +braceExpression + : BRACE_OPEN braceContent* BRACE_CLOSE + ; + +braceContent + : braceExpression + | braceText (NEWLINE* braceText)* + ; + +braceText + : TEXT_CONTENT + | NAME + | SPACE + | STAR + | SLASH + | NEWLINE + ; + +NAME + : [a-zA-Z]+ + ; + +NEWLINE + : '\n' (SPACE? (STAR {_input.LA(1) != '/'}?)+)? + | '\r\n' (SPACE? (STAR {_input.LA(1) != '/'}?)+)? + | '\r' (SPACE? (STAR {_input.LA(1) != '/'}?)+)? + ; + +SPACE + : (' '|'\t')+ + ; + +TEXT_CONTENT + : ~[\n\r\t @*{}/a-zA-Z]+ + ; + +AT + : '@' + ; + +STAR + : '*' + ; + +SLASH + : '/' + ; + +MCFPPDOC_START + : '/**' STAR* + ; + +MCFPPDOC_END + : SPACE? STAR* '*/' + ; + +INLINE_TAG_START + : '{@' + ; + +BRACE_OPEN + : '{' + ; + +BRACE_CLOSE + : '}' + ; \ No newline at end of file diff --git a/src/main/antlr/unicodeClass.g4 b/src/main/antlr/unicodeClass.g4 new file mode 100644 index 00000000..383c7f4c --- /dev/null +++ b/src/main/antlr/unicodeClass.g4 @@ -0,0 +1,2726 @@ +lexer grammar unicodeClass; + +/** + * taken from https://www.antlr3.org/grammar/1345144569663/AntlrUnicode.txt + */ + +UNICODE_CLASS_CC: + '\u0000'..'\u001F' | + '\u007F'..'\u009F'; + +UNICODE_CLASS_CF: + '\u00AD' | + '\u0600'..'\u0604' | + '\u06DD' | + '\u070F' | + '\u200B'..'\u200F' | + '\u202A'..'\u202E' | + '\u2060'..'\u2064' | + '\u206A'..'\u206F' | + '\uFEFF' | + '\uFFF9'..'\uFFFB'; + +UNICODE_CLASS_CO: + '\uE000' | + '\uF8FF'; + +UNICODE_CLASS_CS: + '\uD800' | + '\uDB7F' | + '\uDB80' | + '\uDBFF' | + '\uDC00' | + '\uDFFF'; + +UNICODE_CLASS_LL: + '\u0061'..'\u007A' | + '\u00B5' | + '\u00DF'..'\u00F6' | + '\u00F8'..'\u00FF' | + '\u0101' | + '\u0103' | + '\u0105' | + '\u0107' | + '\u0109' | + '\u010B' | + '\u010D' | + '\u010F' | + '\u0111' | + '\u0113' | + '\u0115' | + '\u0117' | + '\u0119' | + '\u011B' | + '\u011D' | + '\u011F' | + '\u0121' | + '\u0123' | + '\u0125' | + '\u0127' | + '\u0129' | + '\u012B' | + '\u012D' | + '\u012F' | + '\u0131' | + '\u0133' | + '\u0135' | + '\u0137' | + '\u0138' | + '\u013A' | + '\u013C' | + '\u013E' | + '\u0140' | + '\u0142' | + '\u0144' | + '\u0146' | + '\u0148' | + '\u0149' | + '\u014B' | + '\u014D' | + '\u014F' | + '\u0151' | + '\u0153' | + '\u0155' | + '\u0157' | + '\u0159' | + '\u015B' | + '\u015D' | + '\u015F' | + '\u0161' | + '\u0163' | + '\u0165' | + '\u0167' | + '\u0169' | + '\u016B' | + '\u016D' | + '\u016F' | + '\u0171' | + '\u0173' | + '\u0175' | + '\u0177' | + '\u017A' | + '\u017C' | + '\u017E'..'\u0180' | + '\u0183' | + '\u0185' | + '\u0188' | + '\u018C' | + '\u018D' | + '\u0192' | + '\u0195' | + '\u0199'..'\u019B' | + '\u019E' | + '\u01A1' | + '\u01A3' | + '\u01A5' | + '\u01A8' | + '\u01AA' | + '\u01AB' | + '\u01AD' | + '\u01B0' | + '\u01B4' | + '\u01B6' | + '\u01B9' | + '\u01BA' | + '\u01BD'..'\u01BF' | + '\u01C6' | + '\u01C9' | + '\u01CC' | + '\u01CE' | + '\u01D0' | + '\u01D2' | + '\u01D4' | + '\u01D6' | + '\u01D8' | + '\u01DA' | + '\u01DC' | + '\u01DD' | + '\u01DF' | + '\u01E1' | + '\u01E3' | + '\u01E5' | + '\u01E7' | + '\u01E9' | + '\u01EB' | + '\u01ED' | + '\u01EF' | + '\u01F0' | + '\u01F3' | + '\u01F5' | + '\u01F9' | + '\u01FB' | + '\u01FD' | + '\u01FF' | + '\u0201' | + '\u0203' | + '\u0205' | + '\u0207' | + '\u0209' | + '\u020B' | + '\u020D' | + '\u020F' | + '\u0211' | + '\u0213' | + '\u0215' | + '\u0217' | + '\u0219' | + '\u021B' | + '\u021D' | + '\u021F' | + '\u0221' | + '\u0223' | + '\u0225' | + '\u0227' | + '\u0229' | + '\u022B' | + '\u022D' | + '\u022F' | + '\u0231' | + '\u0233'..'\u0239' | + '\u023C' | + '\u023F' | + '\u0240' | + '\u0242' | + '\u0247' | + '\u0249' | + '\u024B' | + '\u024D' | + '\u024F'..'\u0293' | + '\u0295'..'\u02AF' | + '\u0371' | + '\u0373' | + '\u0377' | + '\u037B'..'\u037D' | + '\u0390' | + '\u03AC'..'\u03CE' | + '\u03D0' | + '\u03D1' | + '\u03D5'..'\u03D7' | + '\u03D9' | + '\u03DB' | + '\u03DD' | + '\u03DF' | + '\u03E1' | + '\u03E3' | + '\u03E5' | + '\u03E7' | + '\u03E9' | + '\u03EB' | + '\u03ED' | + '\u03EF'..'\u03F3' | + '\u03F5' | + '\u03F8' | + '\u03FB' | + '\u03FC' | + '\u0430'..'\u045F' | + '\u0461' | + '\u0463' | + '\u0465' | + '\u0467' | + '\u0469' | + '\u046B' | + '\u046D' | + '\u046F' | + '\u0471' | + '\u0473' | + '\u0475' | + '\u0477' | + '\u0479' | + '\u047B' | + '\u047D' | + '\u047F' | + '\u0481' | + '\u048B' | + '\u048D' | + '\u048F' | + '\u0491' | + '\u0493' | + '\u0495' | + '\u0497' | + '\u0499' | + '\u049B' | + '\u049D' | + '\u049F' | + '\u04A1' | + '\u04A3' | + '\u04A5' | + '\u04A7' | + '\u04A9' | + '\u04AB' | + '\u04AD' | + '\u04AF' | + '\u04B1' | + '\u04B3' | + '\u04B5' | + '\u04B7' | + '\u04B9' | + '\u04BB' | + '\u04BD' | + '\u04BF' | + '\u04C2' | + '\u04C4' | + '\u04C6' | + '\u04C8' | + '\u04CA' | + '\u04CC' | + '\u04CE' | + '\u04CF' | + '\u04D1' | + '\u04D3' | + '\u04D5' | + '\u04D7' | + '\u04D9' | + '\u04DB' | + '\u04DD' | + '\u04DF' | + '\u04E1' | + '\u04E3' | + '\u04E5' | + '\u04E7' | + '\u04E9' | + '\u04EB' | + '\u04ED' | + '\u04EF' | + '\u04F1' | + '\u04F3' | + '\u04F5' | + '\u04F7' | + '\u04F9' | + '\u04FB' | + '\u04FD' | + '\u04FF' | + '\u0501' | + '\u0503' | + '\u0505' | + '\u0507' | + '\u0509' | + '\u050B' | + '\u050D' | + '\u050F' | + '\u0511' | + '\u0513' | + '\u0515' | + '\u0517' | + '\u0519' | + '\u051B' | + '\u051D' | + '\u051F' | + '\u0521' | + '\u0523' | + '\u0525' | + '\u0527' | + '\u0561'..'\u0587' | + '\u1D00'..'\u1D2B' | + '\u1D6B'..'\u1D77' | + '\u1D79'..'\u1D9A' | + '\u1E01' | + '\u1E03' | + '\u1E05' | + '\u1E07' | + '\u1E09' | + '\u1E0B' | + '\u1E0D' | + '\u1E0F' | + '\u1E11' | + '\u1E13' | + '\u1E15' | + '\u1E17' | + '\u1E19' | + '\u1E1B' | + '\u1E1D' | + '\u1E1F' | + '\u1E21' | + '\u1E23' | + '\u1E25' | + '\u1E27' | + '\u1E29' | + '\u1E2B' | + '\u1E2D' | + '\u1E2F' | + '\u1E31' | + '\u1E33' | + '\u1E35' | + '\u1E37' | + '\u1E39' | + '\u1E3B' | + '\u1E3D' | + '\u1E3F' | + '\u1E41' | + '\u1E43' | + '\u1E45' | + '\u1E47' | + '\u1E49' | + '\u1E4B' | + '\u1E4D' | + '\u1E4F' | + '\u1E51' | + '\u1E53' | + '\u1E55' | + '\u1E57' | + '\u1E59' | + '\u1E5B' | + '\u1E5D' | + '\u1E5F' | + '\u1E61' | + '\u1E63' | + '\u1E65' | + '\u1E67' | + '\u1E69' | + '\u1E6B' | + '\u1E6D' | + '\u1E6F' | + '\u1E71' | + '\u1E73' | + '\u1E75' | + '\u1E77' | + '\u1E79' | + '\u1E7B' | + '\u1E7D' | + '\u1E7F' | + '\u1E81' | + '\u1E83' | + '\u1E85' | + '\u1E87' | + '\u1E89' | + '\u1E8B' | + '\u1E8D' | + '\u1E8F' | + '\u1E91' | + '\u1E93' | + '\u1E95'..'\u1E9D' | + '\u1E9F' | + '\u1EA1' | + '\u1EA3' | + '\u1EA5' | + '\u1EA7' | + '\u1EA9' | + '\u1EAB' | + '\u1EAD' | + '\u1EAF' | + '\u1EB1' | + '\u1EB3' | + '\u1EB5' | + '\u1EB7' | + '\u1EB9' | + '\u1EBB' | + '\u1EBD' | + '\u1EBF' | + '\u1EC1' | + '\u1EC3' | + '\u1EC5' | + '\u1EC7' | + '\u1EC9' | + '\u1ECB' | + '\u1ECD' | + '\u1ECF' | + '\u1ED1' | + '\u1ED3' | + '\u1ED5' | + '\u1ED7' | + '\u1ED9' | + '\u1EDB' | + '\u1EDD' | + '\u1EDF' | + '\u1EE1' | + '\u1EE3' | + '\u1EE5' | + '\u1EE7' | + '\u1EE9' | + '\u1EEB' | + '\u1EED' | + '\u1EEF' | + '\u1EF1' | + '\u1EF3' | + '\u1EF5' | + '\u1EF7' | + '\u1EF9' | + '\u1EFB' | + '\u1EFD' | + '\u1EFF'..'\u1F07' | + '\u1F10'..'\u1F15' | + '\u1F20'..'\u1F27' | + '\u1F30'..'\u1F37' | + '\u1F40'..'\u1F45' | + '\u1F50'..'\u1F57' | + '\u1F60'..'\u1F67' | + '\u1F70'..'\u1F7D' | + '\u1F80'..'\u1F87' | + '\u1F90'..'\u1F97' | + '\u1FA0'..'\u1FA7' | + '\u1FB0'..'\u1FB4' | + '\u1FB6' | + '\u1FB7' | + '\u1FBE' | + '\u1FC2'..'\u1FC4' | + '\u1FC6' | + '\u1FC7' | + '\u1FD0'..'\u1FD3' | + '\u1FD6' | + '\u1FD7' | + '\u1FE0'..'\u1FE7' | + '\u1FF2'..'\u1FF4' | + '\u1FF6' | + '\u1FF7' | + '\u210A' | + '\u210E' | + '\u210F' | + '\u2113' | + '\u212F' | + '\u2134' | + '\u2139' | + '\u213C' | + '\u213D' | + '\u2146'..'\u2149' | + '\u214E' | + '\u2184' | + '\u2C30'..'\u2C5E' | + '\u2C61' | + '\u2C65' | + '\u2C66' | + '\u2C68' | + '\u2C6A' | + '\u2C6C' | + '\u2C71' | + '\u2C73' | + '\u2C74' | + '\u2C76'..'\u2C7B' | + '\u2C81' | + '\u2C83' | + '\u2C85' | + '\u2C87' | + '\u2C89' | + '\u2C8B' | + '\u2C8D' | + '\u2C8F' | + '\u2C91' | + '\u2C93' | + '\u2C95' | + '\u2C97' | + '\u2C99' | + '\u2C9B' | + '\u2C9D' | + '\u2C9F' | + '\u2CA1' | + '\u2CA3' | + '\u2CA5' | + '\u2CA7' | + '\u2CA9' | + '\u2CAB' | + '\u2CAD' | + '\u2CAF' | + '\u2CB1' | + '\u2CB3' | + '\u2CB5' | + '\u2CB7' | + '\u2CB9' | + '\u2CBB' | + '\u2CBD' | + '\u2CBF' | + '\u2CC1' | + '\u2CC3' | + '\u2CC5' | + '\u2CC7' | + '\u2CC9' | + '\u2CCB' | + '\u2CCD' | + '\u2CCF' | + '\u2CD1' | + '\u2CD3' | + '\u2CD5' | + '\u2CD7' | + '\u2CD9' | + '\u2CDB' | + '\u2CDD' | + '\u2CDF' | + '\u2CE1' | + '\u2CE3' | + '\u2CE4' | + '\u2CEC' | + '\u2CEE' | + '\u2CF3' | + '\u2D00'..'\u2D25' | + '\u2D27' | + '\u2D2D' | + '\uA641' | + '\uA643' | + '\uA645' | + '\uA647' | + '\uA649' | + '\uA64B' | + '\uA64D' | + '\uA64F' | + '\uA651' | + '\uA653' | + '\uA655' | + '\uA657' | + '\uA659' | + '\uA65B' | + '\uA65D' | + '\uA65F' | + '\uA661' | + '\uA663' | + '\uA665' | + '\uA667' | + '\uA669' | + '\uA66B' | + '\uA66D' | + '\uA681' | + '\uA683' | + '\uA685' | + '\uA687' | + '\uA689' | + '\uA68B' | + '\uA68D' | + '\uA68F' | + '\uA691' | + '\uA693' | + '\uA695' | + '\uA697' | + '\uA723' | + '\uA725' | + '\uA727' | + '\uA729' | + '\uA72B' | + '\uA72D' | + '\uA72F'..'\uA731' | + '\uA733' | + '\uA735' | + '\uA737' | + '\uA739' | + '\uA73B' | + '\uA73D' | + '\uA73F' | + '\uA741' | + '\uA743' | + '\uA745' | + '\uA747' | + '\uA749' | + '\uA74B' | + '\uA74D' | + '\uA74F' | + '\uA751' | + '\uA753' | + '\uA755' | + '\uA757' | + '\uA759' | + '\uA75B' | + '\uA75D' | + '\uA75F' | + '\uA761' | + '\uA763' | + '\uA765' | + '\uA767' | + '\uA769' | + '\uA76B' | + '\uA76D' | + '\uA76F' | + '\uA771'..'\uA778' | + '\uA77A' | + '\uA77C' | + '\uA77F' | + '\uA781' | + '\uA783' | + '\uA785' | + '\uA787' | + '\uA78C' | + '\uA78E' | + '\uA791' | + '\uA793' | + '\uA7A1' | + '\uA7A3' | + '\uA7A5' | + '\uA7A7' | + '\uA7A9' | + '\uA7FA' | + '\uFB00'..'\uFB06' | + '\uFB13'..'\uFB17' | + '\uFF41'..'\uFF5A'; + +UNICODE_CLASS_LM: + '\u02B0'..'\u02C1' | + '\u02C6'..'\u02D1' | + '\u02E0'..'\u02E4' | + '\u02EC' | + '\u02EE' | + '\u0374' | + '\u037A' | + '\u0559' | + '\u0640' | + '\u06E5' | + '\u06E6' | + '\u07F4' | + '\u07F5' | + '\u07FA' | + '\u081A' | + '\u0824' | + '\u0828' | + '\u0971' | + '\u0E46' | + '\u0EC6' | + '\u10FC' | + '\u17D7' | + '\u1843' | + '\u1AA7' | + '\u1C78'..'\u1C7D' | + '\u1D2C'..'\u1D6A' | + '\u1D78' | + '\u1D9B'..'\u1DBF' | + '\u2071' | + '\u207F' | + '\u2090'..'\u209C' | + '\u2C7C' | + '\u2C7D' | + '\u2D6F' | + '\u2E2F' | + '\u3005' | + '\u3031'..'\u3035' | + '\u303B' | + '\u309D' | + '\u309E' | + '\u30FC'..'\u30FE' | + '\uA015' | + '\uA4F8'..'\uA4FD' | + '\uA60C' | + '\uA67F' | + '\uA717'..'\uA71F' | + '\uA770' | + '\uA788' | + '\uA7F8' | + '\uA7F9' | + '\uA9CF' | + '\uAA70' | + '\uAADD' | + '\uAAF3' | + '\uAAF4' | + '\uFF70' | + '\uFF9E' | + '\uFF9F'; + +UNICODE_CLASS_LO: + '\u00AA' | + '\u00BA' | + '\u01BB' | + '\u01C0'..'\u01C3' | + '\u0294' | + '\u05D0'..'\u05EA' | + '\u05F0'..'\u05F2' | + '\u0620'..'\u063F' | + '\u0641'..'\u064A' | + '\u066E' | + '\u066F' | + '\u0671'..'\u06D3' | + '\u06D5' | + '\u06EE' | + '\u06EF' | + '\u06FA'..'\u06FC' | + '\u06FF' | + '\u0710' | + '\u0712'..'\u072F' | + '\u074D'..'\u07A5' | + '\u07B1' | + '\u07CA'..'\u07EA' | + '\u0800'..'\u0815' | + '\u0840'..'\u0858' | + '\u08A0' | + '\u08A2'..'\u08AC' | + '\u0904'..'\u0939' | + '\u093D' | + '\u0950' | + '\u0958'..'\u0961' | + '\u0972'..'\u0977' | + '\u0979'..'\u097F' | + '\u0985'..'\u098C' | + '\u098F' | + '\u0990' | + '\u0993'..'\u09A8' | + '\u09AA'..'\u09B0' | + '\u09B2' | + '\u09B6'..'\u09B9' | + '\u09BD' | + '\u09CE' | + '\u09DC' | + '\u09DD' | + '\u09DF'..'\u09E1' | + '\u09F0' | + '\u09F1' | + '\u0A05'..'\u0A0A' | + '\u0A0F' | + '\u0A10' | + '\u0A13'..'\u0A28' | + '\u0A2A'..'\u0A30' | + '\u0A32' | + '\u0A33' | + '\u0A35' | + '\u0A36' | + '\u0A38' | + '\u0A39' | + '\u0A59'..'\u0A5C' | + '\u0A5E' | + '\u0A72'..'\u0A74' | + '\u0A85'..'\u0A8D' | + '\u0A8F'..'\u0A91' | + '\u0A93'..'\u0AA8' | + '\u0AAA'..'\u0AB0' | + '\u0AB2' | + '\u0AB3' | + '\u0AB5'..'\u0AB9' | + '\u0ABD' | + '\u0AD0' | + '\u0AE0' | + '\u0AE1' | + '\u0B05'..'\u0B0C' | + '\u0B0F' | + '\u0B10' | + '\u0B13'..'\u0B28' | + '\u0B2A'..'\u0B30' | + '\u0B32' | + '\u0B33' | + '\u0B35'..'\u0B39' | + '\u0B3D' | + '\u0B5C' | + '\u0B5D' | + '\u0B5F'..'\u0B61' | + '\u0B71' | + '\u0B83' | + '\u0B85'..'\u0B8A' | + '\u0B8E'..'\u0B90' | + '\u0B92'..'\u0B95' | + '\u0B99' | + '\u0B9A' | + '\u0B9C' | + '\u0B9E' | + '\u0B9F' | + '\u0BA3' | + '\u0BA4' | + '\u0BA8'..'\u0BAA' | + '\u0BAE'..'\u0BB9' | + '\u0BD0' | + '\u0C05'..'\u0C0C' | + '\u0C0E'..'\u0C10' | + '\u0C12'..'\u0C28' | + '\u0C2A'..'\u0C33' | + '\u0C35'..'\u0C39' | + '\u0C3D' | + '\u0C58' | + '\u0C59' | + '\u0C60' | + '\u0C61' | + '\u0C85'..'\u0C8C' | + '\u0C8E'..'\u0C90' | + '\u0C92'..'\u0CA8' | + '\u0CAA'..'\u0CB3' | + '\u0CB5'..'\u0CB9' | + '\u0CBD' | + '\u0CDE' | + '\u0CE0' | + '\u0CE1' | + '\u0CF1' | + '\u0CF2' | + '\u0D05'..'\u0D0C' | + '\u0D0E'..'\u0D10' | + '\u0D12'..'\u0D3A' | + '\u0D3D' | + '\u0D4E' | + '\u0D60' | + '\u0D61' | + '\u0D7A'..'\u0D7F' | + '\u0D85'..'\u0D96' | + '\u0D9A'..'\u0DB1' | + '\u0DB3'..'\u0DBB' | + '\u0DBD' | + '\u0DC0'..'\u0DC6' | + '\u0E01'..'\u0E30' | + '\u0E32' | + '\u0E33' | + '\u0E40'..'\u0E45' | + '\u0E81' | + '\u0E82' | + '\u0E84' | + '\u0E87' | + '\u0E88' | + '\u0E8A' | + '\u0E8D' | + '\u0E94'..'\u0E97' | + '\u0E99'..'\u0E9F' | + '\u0EA1'..'\u0EA3' | + '\u0EA5' | + '\u0EA7' | + '\u0EAA' | + '\u0EAB' | + '\u0EAD'..'\u0EB0' | + '\u0EB2' | + '\u0EB3' | + '\u0EBD' | + '\u0EC0'..'\u0EC4' | + '\u0EDC'..'\u0EDF' | + '\u0F00' | + '\u0F40'..'\u0F47' | + '\u0F49'..'\u0F6C' | + '\u0F88'..'\u0F8C' | + '\u1000'..'\u102A' | + '\u103F' | + '\u1050'..'\u1055' | + '\u105A'..'\u105D' | + '\u1061' | + '\u1065' | + '\u1066' | + '\u106E'..'\u1070' | + '\u1075'..'\u1081' | + '\u108E' | + '\u10D0'..'\u10FA' | + '\u10FD'..'\u1248' | + '\u124A'..'\u124D' | + '\u1250'..'\u1256' | + '\u1258' | + '\u125A'..'\u125D' | + '\u1260'..'\u1288' | + '\u128A'..'\u128D' | + '\u1290'..'\u12B0' | + '\u12B2'..'\u12B5' | + '\u12B8'..'\u12BE' | + '\u12C0' | + '\u12C2'..'\u12C5' | + '\u12C8'..'\u12D6' | + '\u12D8'..'\u1310' | + '\u1312'..'\u1315' | + '\u1318'..'\u135A' | + '\u1380'..'\u138F' | + '\u13A0'..'\u13F4' | + '\u1401'..'\u166C' | + '\u166F'..'\u167F' | + '\u1681'..'\u169A' | + '\u16A0'..'\u16EA' | + '\u1700'..'\u170C' | + '\u170E'..'\u1711' | + '\u1720'..'\u1731' | + '\u1740'..'\u1751' | + '\u1760'..'\u176C' | + '\u176E'..'\u1770' | + '\u1780'..'\u17B3' | + '\u17DC' | + '\u1820'..'\u1842' | + '\u1844'..'\u1877' | + '\u1880'..'\u18A8' | + '\u18AA' | + '\u18B0'..'\u18F5' | + '\u1900'..'\u191C' | + '\u1950'..'\u196D' | + '\u1970'..'\u1974' | + '\u1980'..'\u19AB' | + '\u19C1'..'\u19C7' | + '\u1A00'..'\u1A16' | + '\u1A20'..'\u1A54' | + '\u1B05'..'\u1B33' | + '\u1B45'..'\u1B4B' | + '\u1B83'..'\u1BA0' | + '\u1BAE' | + '\u1BAF' | + '\u1BBA'..'\u1BE5' | + '\u1C00'..'\u1C23' | + '\u1C4D'..'\u1C4F' | + '\u1C5A'..'\u1C77' | + '\u1CE9'..'\u1CEC' | + '\u1CEE'..'\u1CF1' | + '\u1CF5' | + '\u1CF6' | + '\u2135'..'\u2138' | + '\u2D30'..'\u2D67' | + '\u2D80'..'\u2D96' | + '\u2DA0'..'\u2DA6' | + '\u2DA8'..'\u2DAE' | + '\u2DB0'..'\u2DB6' | + '\u2DB8'..'\u2DBE' | + '\u2DC0'..'\u2DC6' | + '\u2DC8'..'\u2DCE' | + '\u2DD0'..'\u2DD6' | + '\u2DD8'..'\u2DDE' | + '\u3006' | + '\u303C' | + '\u3041'..'\u3096' | + '\u309F' | + '\u30A1'..'\u30FA' | + '\u30FF' | + '\u3105'..'\u312D' | + '\u3131'..'\u318E' | + '\u31A0'..'\u31BA' | + '\u31F0'..'\u31FF' | + '\u3400' | + '\u4DB5' | + '\u4E00' | + '\u9FCC' | + '\uA000'..'\uA014' | + '\uA016'..'\uA48C' | + '\uA4D0'..'\uA4F7' | + '\uA500'..'\uA60B' | + '\uA610'..'\uA61F' | + '\uA62A' | + '\uA62B' | + '\uA66E' | + '\uA6A0'..'\uA6E5' | + '\uA7FB'..'\uA801' | + '\uA803'..'\uA805' | + '\uA807'..'\uA80A' | + '\uA80C'..'\uA822' | + '\uA840'..'\uA873' | + '\uA882'..'\uA8B3' | + '\uA8F2'..'\uA8F7' | + '\uA8FB' | + '\uA90A'..'\uA925' | + '\uA930'..'\uA946' | + '\uA960'..'\uA97C' | + '\uA984'..'\uA9B2' | + '\uAA00'..'\uAA28' | + '\uAA40'..'\uAA42' | + '\uAA44'..'\uAA4B' | + '\uAA60'..'\uAA6F' | + '\uAA71'..'\uAA76' | + '\uAA7A' | + '\uAA80'..'\uAAAF' | + '\uAAB1' | + '\uAAB5' | + '\uAAB6' | + '\uAAB9'..'\uAABD' | + '\uAAC0' | + '\uAAC2' | + '\uAADB' | + '\uAADC' | + '\uAAE0'..'\uAAEA' | + '\uAAF2' | + '\uAB01'..'\uAB06' | + '\uAB09'..'\uAB0E' | + '\uAB11'..'\uAB16' | + '\uAB20'..'\uAB26' | + '\uAB28'..'\uAB2E' | + '\uABC0'..'\uABE2' | + '\uAC00' | + '\uD7A3' | + '\uD7B0'..'\uD7C6' | + '\uD7CB'..'\uD7FB' | + '\uF900'..'\uFA6D' | + '\uFA70'..'\uFAD9' | + '\uFB1D' | + '\uFB1F'..'\uFB28' | + '\uFB2A'..'\uFB36' | + '\uFB38'..'\uFB3C' | + '\uFB3E' | + '\uFB40' | + '\uFB41' | + '\uFB43' | + '\uFB44' | + '\uFB46'..'\uFBB1' | + '\uFBD3'..'\uFD3D' | + '\uFD50'..'\uFD8F' | + '\uFD92'..'\uFDC7' | + '\uFDF0'..'\uFDFB' | + '\uFE70'..'\uFE74' | + '\uFE76'..'\uFEFC' | + '\uFF66'..'\uFF6F' | + '\uFF71'..'\uFF9D' | + '\uFFA0'..'\uFFBE' | + '\uFFC2'..'\uFFC7' | + '\uFFCA'..'\uFFCF' | + '\uFFD2'..'\uFFD7' | + '\uFFDA'..'\uFFDC'; + +UNICODE_CLASS_LT: + '\u01C5' | + '\u01C8' | + '\u01CB' | + '\u01F2' | + '\u1F88'..'\u1F8F' | + '\u1F98'..'\u1F9F' | + '\u1FA8'..'\u1FAF' | + '\u1FBC' | + '\u1FCC' | + '\u1FFC'; + +UNICODE_CLASS_LU: + '\u0041'..'\u005A' | + '\u00C0'..'\u00D6' | + '\u00D8'..'\u00DE' | + '\u0100' | + '\u0102' | + '\u0104' | + '\u0106' | + '\u0108' | + '\u010A' | + '\u010C' | + '\u010E' | + '\u0110' | + '\u0112' | + '\u0114' | + '\u0116' | + '\u0118' | + '\u011A' | + '\u011C' | + '\u011E' | + '\u0120' | + '\u0122' | + '\u0124' | + '\u0126' | + '\u0128' | + '\u012A' | + '\u012C' | + '\u012E' | + '\u0130' | + '\u0132' | + '\u0134' | + '\u0136' | + '\u0139' | + '\u013B' | + '\u013D' | + '\u013F' | + '\u0141' | + '\u0143' | + '\u0145' | + '\u0147' | + '\u014A' | + '\u014C' | + '\u014E' | + '\u0150' | + '\u0152' | + '\u0154' | + '\u0156' | + '\u0158' | + '\u015A' | + '\u015C' | + '\u015E' | + '\u0160' | + '\u0162' | + '\u0164' | + '\u0166' | + '\u0168' | + '\u016A' | + '\u016C' | + '\u016E' | + '\u0170' | + '\u0172' | + '\u0174' | + '\u0176' | + '\u0178' | + '\u0179' | + '\u017B' | + '\u017D' | + '\u0181' | + '\u0182' | + '\u0184' | + '\u0186' | + '\u0187' | + '\u0189'..'\u018B' | + '\u018E'..'\u0191' | + '\u0193' | + '\u0194' | + '\u0196'..'\u0198' | + '\u019C' | + '\u019D' | + '\u019F' | + '\u01A0' | + '\u01A2' | + '\u01A4' | + '\u01A6' | + '\u01A7' | + '\u01A9' | + '\u01AC' | + '\u01AE' | + '\u01AF' | + '\u01B1'..'\u01B3' | + '\u01B5' | + '\u01B7' | + '\u01B8' | + '\u01BC' | + '\u01C4' | + '\u01C7' | + '\u01CA' | + '\u01CD' | + '\u01CF' | + '\u01D1' | + '\u01D3' | + '\u01D5' | + '\u01D7' | + '\u01D9' | + '\u01DB' | + '\u01DE' | + '\u01E0' | + '\u01E2' | + '\u01E4' | + '\u01E6' | + '\u01E8' | + '\u01EA' | + '\u01EC' | + '\u01EE' | + '\u01F1' | + '\u01F4' | + '\u01F6'..'\u01F8' | + '\u01FA' | + '\u01FC' | + '\u01FE' | + '\u0200' | + '\u0202' | + '\u0204' | + '\u0206' | + '\u0208' | + '\u020A' | + '\u020C' | + '\u020E' | + '\u0210' | + '\u0212' | + '\u0214' | + '\u0216' | + '\u0218' | + '\u021A' | + '\u021C' | + '\u021E' | + '\u0220' | + '\u0222' | + '\u0224' | + '\u0226' | + '\u0228' | + '\u022A' | + '\u022C' | + '\u022E' | + '\u0230' | + '\u0232' | + '\u023A' | + '\u023B' | + '\u023D' | + '\u023E' | + '\u0241' | + '\u0243'..'\u0246' | + '\u0248' | + '\u024A' | + '\u024C' | + '\u024E' | + '\u0370' | + '\u0372' | + '\u0376' | + '\u0386' | + '\u0388'..'\u038A' | + '\u038C' | + '\u038E' | + '\u038F' | + '\u0391'..'\u03A1' | + '\u03A3'..'\u03AB' | + '\u03CF' | + '\u03D2'..'\u03D4' | + '\u03D8' | + '\u03DA' | + '\u03DC' | + '\u03DE' | + '\u03E0' | + '\u03E2' | + '\u03E4' | + '\u03E6' | + '\u03E8' | + '\u03EA' | + '\u03EC' | + '\u03EE' | + '\u03F4' | + '\u03F7' | + '\u03F9' | + '\u03FA' | + '\u03FD'..'\u042F' | + '\u0460' | + '\u0462' | + '\u0464' | + '\u0466' | + '\u0468' | + '\u046A' | + '\u046C' | + '\u046E' | + '\u0470' | + '\u0472' | + '\u0474' | + '\u0476' | + '\u0478' | + '\u047A' | + '\u047C' | + '\u047E' | + '\u0480' | + '\u048A' | + '\u048C' | + '\u048E' | + '\u0490' | + '\u0492' | + '\u0494' | + '\u0496' | + '\u0498' | + '\u049A' | + '\u049C' | + '\u049E' | + '\u04A0' | + '\u04A2' | + '\u04A4' | + '\u04A6' | + '\u04A8' | + '\u04AA' | + '\u04AC' | + '\u04AE' | + '\u04B0' | + '\u04B2' | + '\u04B4' | + '\u04B6' | + '\u04B8' | + '\u04BA' | + '\u04BC' | + '\u04BE' | + '\u04C0' | + '\u04C1' | + '\u04C3' | + '\u04C5' | + '\u04C7' | + '\u04C9' | + '\u04CB' | + '\u04CD' | + '\u04D0' | + '\u04D2' | + '\u04D4' | + '\u04D6' | + '\u04D8' | + '\u04DA' | + '\u04DC' | + '\u04DE' | + '\u04E0' | + '\u04E2' | + '\u04E4' | + '\u04E6' | + '\u04E8' | + '\u04EA' | + '\u04EC' | + '\u04EE' | + '\u04F0' | + '\u04F2' | + '\u04F4' | + '\u04F6' | + '\u04F8' | + '\u04FA' | + '\u04FC' | + '\u04FE' | + '\u0500' | + '\u0502' | + '\u0504' | + '\u0506' | + '\u0508' | + '\u050A' | + '\u050C' | + '\u050E' | + '\u0510' | + '\u0512' | + '\u0514' | + '\u0516' | + '\u0518' | + '\u051A' | + '\u051C' | + '\u051E' | + '\u0520' | + '\u0522' | + '\u0524' | + '\u0526' | + '\u0531'..'\u0556' | + '\u10A0'..'\u10C5' | + '\u10C7' | + '\u10CD' | + '\u1E00' | + '\u1E02' | + '\u1E04' | + '\u1E06' | + '\u1E08' | + '\u1E0A' | + '\u1E0C' | + '\u1E0E' | + '\u1E10' | + '\u1E12' | + '\u1E14' | + '\u1E16' | + '\u1E18' | + '\u1E1A' | + '\u1E1C' | + '\u1E1E' | + '\u1E20' | + '\u1E22' | + '\u1E24' | + '\u1E26' | + '\u1E28' | + '\u1E2A' | + '\u1E2C' | + '\u1E2E' | + '\u1E30' | + '\u1E32' | + '\u1E34' | + '\u1E36' | + '\u1E38' | + '\u1E3A' | + '\u1E3C' | + '\u1E3E' | + '\u1E40' | + '\u1E42' | + '\u1E44' | + '\u1E46' | + '\u1E48' | + '\u1E4A' | + '\u1E4C' | + '\u1E4E' | + '\u1E50' | + '\u1E52' | + '\u1E54' | + '\u1E56' | + '\u1E58' | + '\u1E5A' | + '\u1E5C' | + '\u1E5E' | + '\u1E60' | + '\u1E62' | + '\u1E64' | + '\u1E66' | + '\u1E68' | + '\u1E6A' | + '\u1E6C' | + '\u1E6E' | + '\u1E70' | + '\u1E72' | + '\u1E74' | + '\u1E76' | + '\u1E78' | + '\u1E7A' | + '\u1E7C' | + '\u1E7E' | + '\u1E80' | + '\u1E82' | + '\u1E84' | + '\u1E86' | + '\u1E88' | + '\u1E8A' | + '\u1E8C' | + '\u1E8E' | + '\u1E90' | + '\u1E92' | + '\u1E94' | + '\u1E9E' | + '\u1EA0' | + '\u1EA2' | + '\u1EA4' | + '\u1EA6' | + '\u1EA8' | + '\u1EAA' | + '\u1EAC' | + '\u1EAE' | + '\u1EB0' | + '\u1EB2' | + '\u1EB4' | + '\u1EB6' | + '\u1EB8' | + '\u1EBA' | + '\u1EBC' | + '\u1EBE' | + '\u1EC0' | + '\u1EC2' | + '\u1EC4' | + '\u1EC6' | + '\u1EC8' | + '\u1ECA' | + '\u1ECC' | + '\u1ECE' | + '\u1ED0' | + '\u1ED2' | + '\u1ED4' | + '\u1ED6' | + '\u1ED8' | + '\u1EDA' | + '\u1EDC' | + '\u1EDE' | + '\u1EE0' | + '\u1EE2' | + '\u1EE4' | + '\u1EE6' | + '\u1EE8' | + '\u1EEA' | + '\u1EEC' | + '\u1EEE' | + '\u1EF0' | + '\u1EF2' | + '\u1EF4' | + '\u1EF6' | + '\u1EF8' | + '\u1EFA' | + '\u1EFC' | + '\u1EFE' | + '\u1F08'..'\u1F0F' | + '\u1F18'..'\u1F1D' | + '\u1F28'..'\u1F2F' | + '\u1F38'..'\u1F3F' | + '\u1F48'..'\u1F4D' | + '\u1F59' | + '\u1F5B' | + '\u1F5D' | + '\u1F5F' | + '\u1F68'..'\u1F6F' | + '\u1FB8'..'\u1FBB' | + '\u1FC8'..'\u1FCB' | + '\u1FD8'..'\u1FDB' | + '\u1FE8'..'\u1FEC' | + '\u1FF8'..'\u1FFB' | + '\u2102' | + '\u2107' | + '\u210B'..'\u210D' | + '\u2110'..'\u2112' | + '\u2115' | + '\u2119'..'\u211D' | + '\u2124' | + '\u2126' | + '\u2128' | + '\u212A'..'\u212D' | + '\u2130'..'\u2133' | + '\u213E' | + '\u213F' | + '\u2145' | + '\u2183' | + '\u2C00'..'\u2C2E' | + '\u2C60' | + '\u2C62'..'\u2C64' | + '\u2C67' | + '\u2C69' | + '\u2C6B' | + '\u2C6D'..'\u2C70' | + '\u2C72' | + '\u2C75' | + '\u2C7E'..'\u2C80' | + '\u2C82' | + '\u2C84' | + '\u2C86' | + '\u2C88' | + '\u2C8A' | + '\u2C8C' | + '\u2C8E' | + '\u2C90' | + '\u2C92' | + '\u2C94' | + '\u2C96' | + '\u2C98' | + '\u2C9A' | + '\u2C9C' | + '\u2C9E' | + '\u2CA0' | + '\u2CA2' | + '\u2CA4' | + '\u2CA6' | + '\u2CA8' | + '\u2CAA' | + '\u2CAC' | + '\u2CAE' | + '\u2CB0' | + '\u2CB2' | + '\u2CB4' | + '\u2CB6' | + '\u2CB8' | + '\u2CBA' | + '\u2CBC' | + '\u2CBE' | + '\u2CC0' | + '\u2CC2' | + '\u2CC4' | + '\u2CC6' | + '\u2CC8' | + '\u2CCA' | + '\u2CCC' | + '\u2CCE' | + '\u2CD0' | + '\u2CD2' | + '\u2CD4' | + '\u2CD6' | + '\u2CD8' | + '\u2CDA' | + '\u2CDC' | + '\u2CDE' | + '\u2CE0' | + '\u2CE2' | + '\u2CEB' | + '\u2CED' | + '\u2CF2' | + '\uA640' | + '\uA642' | + '\uA644' | + '\uA646' | + '\uA648' | + '\uA64A' | + '\uA64C' | + '\uA64E' | + '\uA650' | + '\uA652' | + '\uA654' | + '\uA656' | + '\uA658' | + '\uA65A' | + '\uA65C' | + '\uA65E' | + '\uA660' | + '\uA662' | + '\uA664' | + '\uA666' | + '\uA668' | + '\uA66A' | + '\uA66C' | + '\uA680' | + '\uA682' | + '\uA684' | + '\uA686' | + '\uA688' | + '\uA68A' | + '\uA68C' | + '\uA68E' | + '\uA690' | + '\uA692' | + '\uA694' | + '\uA696' | + '\uA722' | + '\uA724' | + '\uA726' | + '\uA728' | + '\uA72A' | + '\uA72C' | + '\uA72E' | + '\uA732' | + '\uA734' | + '\uA736' | + '\uA738' | + '\uA73A' | + '\uA73C' | + '\uA73E' | + '\uA740' | + '\uA742' | + '\uA744' | + '\uA746' | + '\uA748' | + '\uA74A' | + '\uA74C' | + '\uA74E' | + '\uA750' | + '\uA752' | + '\uA754' | + '\uA756' | + '\uA758' | + '\uA75A' | + '\uA75C' | + '\uA75E' | + '\uA760' | + '\uA762' | + '\uA764' | + '\uA766' | + '\uA768' | + '\uA76A' | + '\uA76C' | + '\uA76E' | + '\uA779' | + '\uA77B' | + '\uA77D' | + '\uA77E' | + '\uA780' | + '\uA782' | + '\uA784' | + '\uA786' | + '\uA78B' | + '\uA78D' | + '\uA790' | + '\uA792' | + '\uA7A0' | + '\uA7A2' | + '\uA7A4' | + '\uA7A6' | + '\uA7A8' | + '\uA7AA' | + '\uFF21'..'\uFF3A'; + +UNICODE_CLASS_MC: + '\u0903' | + '\u093B' | + '\u093E'..'\u0940' | + '\u0949'..'\u094C' | + '\u094E' | + '\u094F' | + '\u0982' | + '\u0983' | + '\u09BE'..'\u09C0' | + '\u09C7' | + '\u09C8' | + '\u09CB' | + '\u09CC' | + '\u09D7' | + '\u0A03' | + '\u0A3E'..'\u0A40' | + '\u0A83' | + '\u0ABE'..'\u0AC0' | + '\u0AC9' | + '\u0ACB' | + '\u0ACC' | + '\u0B02' | + '\u0B03' | + '\u0B3E' | + '\u0B40' | + '\u0B47' | + '\u0B48' | + '\u0B4B' | + '\u0B4C' | + '\u0B57' | + '\u0BBE' | + '\u0BBF' | + '\u0BC1' | + '\u0BC2' | + '\u0BC6'..'\u0BC8' | + '\u0BCA'..'\u0BCC' | + '\u0BD7' | + '\u0C01'..'\u0C03' | + '\u0C41'..'\u0C44' | + '\u0C82' | + '\u0C83' | + '\u0CBE' | + '\u0CC0'..'\u0CC4' | + '\u0CC7' | + '\u0CC8' | + '\u0CCA' | + '\u0CCB' | + '\u0CD5' | + '\u0CD6' | + '\u0D02' | + '\u0D03' | + '\u0D3E'..'\u0D40' | + '\u0D46'..'\u0D48' | + '\u0D4A'..'\u0D4C' | + '\u0D57' | + '\u0D82' | + '\u0D83' | + '\u0DCF'..'\u0DD1' | + '\u0DD8'..'\u0DDF' | + '\u0DF2' | + '\u0DF3' | + '\u0F3E' | + '\u0F3F' | + '\u0F7F' | + '\u102B' | + '\u102C' | + '\u1031' | + '\u1038' | + '\u103B' | + '\u103C' | + '\u1056' | + '\u1057' | + '\u1062'..'\u1064' | + '\u1067'..'\u106D' | + '\u1083' | + '\u1084' | + '\u1087'..'\u108C' | + '\u108F' | + '\u109A'..'\u109C' | + '\u17B6' | + '\u17BE'..'\u17C5' | + '\u17C7' | + '\u17C8' | + '\u1923'..'\u1926' | + '\u1929'..'\u192B' | + '\u1930' | + '\u1931' | + '\u1933'..'\u1938' | + '\u19B0'..'\u19C0' | + '\u19C8' | + '\u19C9' | + '\u1A19'..'\u1A1B' | + '\u1A55' | + '\u1A57' | + '\u1A61' | + '\u1A63' | + '\u1A64' | + '\u1A6D'..'\u1A72' | + '\u1B04' | + '\u1B35' | + '\u1B3B' | + '\u1B3D'..'\u1B41' | + '\u1B43' | + '\u1B44' | + '\u1B82' | + '\u1BA1' | + '\u1BA6' | + '\u1BA7' | + '\u1BAA' | + '\u1BAC' | + '\u1BAD' | + '\u1BE7' | + '\u1BEA'..'\u1BEC' | + '\u1BEE' | + '\u1BF2' | + '\u1BF3' | + '\u1C24'..'\u1C2B' | + '\u1C34' | + '\u1C35' | + '\u1CE1' | + '\u1CF2' | + '\u1CF3' | + '\u302E' | + '\u302F' | + '\uA823' | + '\uA824' | + '\uA827' | + '\uA880' | + '\uA881' | + '\uA8B4'..'\uA8C3' | + '\uA952' | + '\uA953' | + '\uA983' | + '\uA9B4' | + '\uA9B5' | + '\uA9BA' | + '\uA9BB' | + '\uA9BD'..'\uA9C0' | + '\uAA2F' | + '\uAA30' | + '\uAA33' | + '\uAA34' | + '\uAA4D' | + '\uAA7B' | + '\uAAEB' | + '\uAAEE' | + '\uAAEF' | + '\uAAF5' | + '\uABE3' | + '\uABE4' | + '\uABE6' | + '\uABE7' | + '\uABE9' | + '\uABEA' | + '\uABEC'; + +UNICODE_CLASS_ME: + '\u0488' | + '\u0489' | + '\u20DD'..'\u20E0' | + '\u20E2'..'\u20E4' | + '\uA670'..'\uA672'; + +UNICODE_CLASS_MN: + '\u0300'..'\u036F' | + '\u0483'..'\u0487' | + '\u0591'..'\u05BD' | + '\u05BF' | + '\u05C1' | + '\u05C2' | + '\u05C4' | + '\u05C5' | + '\u05C7' | + '\u0610'..'\u061A' | + '\u064B'..'\u065F' | + '\u0670' | + '\u06D6'..'\u06DC' | + '\u06DF'..'\u06E4' | + '\u06E7' | + '\u06E8' | + '\u06EA'..'\u06ED' | + '\u0711' | + '\u0730'..'\u074A' | + '\u07A6'..'\u07B0' | + '\u07EB'..'\u07F3' | + '\u0816'..'\u0819' | + '\u081B'..'\u0823' | + '\u0825'..'\u0827' | + '\u0829'..'\u082D' | + '\u0859'..'\u085B' | + '\u08E4'..'\u08FE' | + '\u0900'..'\u0902' | + '\u093A' | + '\u093C' | + '\u0941'..'\u0948' | + '\u094D' | + '\u0951'..'\u0957' | + '\u0962' | + '\u0963' | + '\u0981' | + '\u09BC' | + '\u09C1'..'\u09C4' | + '\u09CD' | + '\u09E2' | + '\u09E3' | + '\u0A01' | + '\u0A02' | + '\u0A3C' | + '\u0A41' | + '\u0A42' | + '\u0A47' | + '\u0A48' | + '\u0A4B'..'\u0A4D' | + '\u0A51' | + '\u0A70' | + '\u0A71' | + '\u0A75' | + '\u0A81' | + '\u0A82' | + '\u0ABC' | + '\u0AC1'..'\u0AC5' | + '\u0AC7' | + '\u0AC8' | + '\u0ACD' | + '\u0AE2' | + '\u0AE3' | + '\u0B01' | + '\u0B3C' | + '\u0B3F' | + '\u0B41'..'\u0B44' | + '\u0B4D' | + '\u0B56' | + '\u0B62' | + '\u0B63' | + '\u0B82' | + '\u0BC0' | + '\u0BCD' | + '\u0C3E'..'\u0C40' | + '\u0C46'..'\u0C48' | + '\u0C4A'..'\u0C4D' | + '\u0C55' | + '\u0C56' | + '\u0C62' | + '\u0C63' | + '\u0CBC' | + '\u0CBF' | + '\u0CC6' | + '\u0CCC' | + '\u0CCD' | + '\u0CE2' | + '\u0CE3' | + '\u0D41'..'\u0D44' | + '\u0D4D' | + '\u0D62' | + '\u0D63' | + '\u0DCA' | + '\u0DD2'..'\u0DD4' | + '\u0DD6' | + '\u0E31' | + '\u0E34'..'\u0E3A' | + '\u0E47'..'\u0E4E' | + '\u0EB1' | + '\u0EB4'..'\u0EB9' | + '\u0EBB' | + '\u0EBC' | + '\u0EC8'..'\u0ECD' | + '\u0F18' | + '\u0F19' | + '\u0F35' | + '\u0F37' | + '\u0F39' | + '\u0F71'..'\u0F7E' | + '\u0F80'..'\u0F84' | + '\u0F86' | + '\u0F87' | + '\u0F8D'..'\u0F97' | + '\u0F99'..'\u0FBC' | + '\u0FC6' | + '\u102D'..'\u1030' | + '\u1032'..'\u1037' | + '\u1039' | + '\u103A' | + '\u103D' | + '\u103E' | + '\u1058' | + '\u1059' | + '\u105E'..'\u1060' | + '\u1071'..'\u1074' | + '\u1082' | + '\u1085' | + '\u1086' | + '\u108D' | + '\u109D' | + '\u135D'..'\u135F' | + '\u1712'..'\u1714' | + '\u1732'..'\u1734' | + '\u1752' | + '\u1753' | + '\u1772' | + '\u1773' | + '\u17B4' | + '\u17B5' | + '\u17B7'..'\u17BD' | + '\u17C6' | + '\u17C9'..'\u17D3' | + '\u17DD' | + '\u180B'..'\u180D' | + '\u18A9' | + '\u1920'..'\u1922' | + '\u1927' | + '\u1928' | + '\u1932' | + '\u1939'..'\u193B' | + '\u1A17' | + '\u1A18' | + '\u1A56' | + '\u1A58'..'\u1A5E' | + '\u1A60' | + '\u1A62' | + '\u1A65'..'\u1A6C' | + '\u1A73'..'\u1A7C' | + '\u1A7F' | + '\u1B00'..'\u1B03' | + '\u1B34' | + '\u1B36'..'\u1B3A' | + '\u1B3C' | + '\u1B42' | + '\u1B6B'..'\u1B73' | + '\u1B80' | + '\u1B81' | + '\u1BA2'..'\u1BA5' | + '\u1BA8' | + '\u1BA9' | + '\u1BAB' | + '\u1BE6' | + '\u1BE8' | + '\u1BE9' | + '\u1BED' | + '\u1BEF'..'\u1BF1' | + '\u1C2C'..'\u1C33' | + '\u1C36' | + '\u1C37' | + '\u1CD0'..'\u1CD2' | + '\u1CD4'..'\u1CE0' | + '\u1CE2'..'\u1CE8' | + '\u1CED' | + '\u1CF4' | + '\u1DC0'..'\u1DE6' | + '\u1DFC'..'\u1DFF' | + '\u20D0'..'\u20DC' | + '\u20E1' | + '\u20E5'..'\u20F0' | + '\u2CEF'..'\u2CF1' | + '\u2D7F' | + '\u2DE0'..'\u2DFF' | + '\u302A'..'\u302D' | + '\u3099' | + '\u309A' | + '\uA66F' | + '\uA674'..'\uA67D' | + '\uA69F' | + '\uA6F0' | + '\uA6F1' | + '\uA802' | + '\uA806' | + '\uA80B' | + '\uA825' | + '\uA826' | + '\uA8C4' | + '\uA8E0'..'\uA8F1' | + '\uA926'..'\uA92D' | + '\uA947'..'\uA951' | + '\uA980'..'\uA982' | + '\uA9B3' | + '\uA9B6'..'\uA9B9' | + '\uA9BC' | + '\uAA29'..'\uAA2E' | + '\uAA31' | + '\uAA32' | + '\uAA35' | + '\uAA36' | + '\uAA43' | + '\uAA4C' | + '\uAAB0' | + '\uAAB2'..'\uAAB4' | + '\uAAB7' | + '\uAAB8' | + '\uAABE' | + '\uAABF' | + '\uAAC1' | + '\uAAEC' | + '\uAAED' | + '\uAAF6' | + '\uABE5' | + '\uABE8' | + '\uABED' | + '\uFB1E' | + '\uFE00'..'\uFE0F' | + '\uFE20'..'\uFE26'; + +UNICODE_CLASS_ND: + '\u0030'..'\u0039' | + '\u0660'..'\u0669' | + '\u06F0'..'\u06F9' | + '\u07C0'..'\u07C9' | + '\u0966'..'\u096F' | + '\u09E6'..'\u09EF' | + '\u0A66'..'\u0A6F' | + '\u0AE6'..'\u0AEF' | + '\u0B66'..'\u0B6F' | + '\u0BE6'..'\u0BEF' | + '\u0C66'..'\u0C6F' | + '\u0CE6'..'\u0CEF' | + '\u0D66'..'\u0D6F' | + '\u0E50'..'\u0E59' | + '\u0ED0'..'\u0ED9' | + '\u0F20'..'\u0F29' | + '\u1040'..'\u1049' | + '\u1090'..'\u1099' | + '\u17E0'..'\u17E9' | + '\u1810'..'\u1819' | + '\u1946'..'\u194F' | + '\u19D0'..'\u19D9' | + '\u1A80'..'\u1A89' | + '\u1A90'..'\u1A99' | + '\u1B50'..'\u1B59' | + '\u1BB0'..'\u1BB9' | + '\u1C40'..'\u1C49' | + '\u1C50'..'\u1C59' | + '\uA620'..'\uA629' | + '\uA8D0'..'\uA8D9' | + '\uA900'..'\uA909' | + '\uA9D0'..'\uA9D9' | + '\uAA50'..'\uAA59' | + '\uABF0'..'\uABF9' | + '\uFF10'..'\uFF19'; + +UNICODE_CLASS_NL: + '\u16EE'..'\u16F0' | + '\u2160'..'\u2182' | + '\u2185'..'\u2188' | + '\u3007' | + '\u3021'..'\u3029' | + '\u3038'..'\u303A' | + '\uA6E6'..'\uA6EF'; + +UNICODE_CLASS_NO: + '\u00B2' | + '\u00B3' | + '\u00B9' | + '\u00BC'..'\u00BE' | + '\u09F4'..'\u09F9' | + '\u0B72'..'\u0B77' | + '\u0BF0'..'\u0BF2' | + '\u0C78'..'\u0C7E' | + '\u0D70'..'\u0D75' | + '\u0F2A'..'\u0F33' | + '\u1369'..'\u137C' | + '\u17F0'..'\u17F9' | + '\u19DA' | + '\u2070' | + '\u2074'..'\u2079' | + '\u2080'..'\u2089' | + '\u2150'..'\u215F' | + '\u2189' | + '\u2460'..'\u249B' | + '\u24EA'..'\u24FF' | + '\u2776'..'\u2793' | + '\u2CFD' | + '\u3192'..'\u3195' | + '\u3220'..'\u3229' | + '\u3248'..'\u324F' | + '\u3251'..'\u325F' | + '\u3280'..'\u3289' | + '\u32B1'..'\u32BF' | + '\uA830'..'\uA835'; + +UNICODE_CLASS_PC: + '\u005F' | + '\u203F' | + '\u2040' | + '\u2054' | + '\uFE33' | + '\uFE34' | + '\uFE4D'..'\uFE4F' | + '\uFF3F'; + +UNICODE_CLASS_PD: + '\u002D' | + '\u058A' | + '\u05BE' | + '\u1400' | + '\u1806' | + '\u2010'..'\u2015' | + '\u2E17' | + '\u2E1A' | + '\u2E3A' | + '\u2E3B' | + '\u301C' | + '\u3030' | + '\u30A0' | + '\uFE31' | + '\uFE32' | + '\uFE58' | + '\uFE63' | + '\uFF0D'; + +UNICODE_CLASS_PE: + '\u0029' | + '\u005D' | + '\u007D' | + '\u0F3B' | + '\u0F3D' | + '\u169C' | + '\u2046' | + '\u207E' | + '\u208E' | + '\u232A' | + '\u2769' | + '\u276B' | + '\u276D' | + '\u276F' | + '\u2771' | + '\u2773' | + '\u2775' | + '\u27C6' | + '\u27E7' | + '\u27E9' | + '\u27EB' | + '\u27ED' | + '\u27EF' | + '\u2984' | + '\u2986' | + '\u2988' | + '\u298A' | + '\u298C' | + '\u298E' | + '\u2990' | + '\u2992' | + '\u2994' | + '\u2996' | + '\u2998' | + '\u29D9' | + '\u29DB' | + '\u29FD' | + '\u2E23' | + '\u2E25' | + '\u2E27' | + '\u2E29' | + '\u3009' | + '\u300B' | + '\u300D' | + '\u300F' | + '\u3011' | + '\u3015' | + '\u3017' | + '\u3019' | + '\u301B' | + '\u301E' | + '\u301F' | + '\uFD3F' | + '\uFE18' | + '\uFE36' | + '\uFE38' | + '\uFE3A' | + '\uFE3C' | + '\uFE3E' | + '\uFE40' | + '\uFE42' | + '\uFE44' | + '\uFE48' | + '\uFE5A' | + '\uFE5C' | + '\uFE5E' | + '\uFF09' | + '\uFF3D' | + '\uFF5D' | + '\uFF60' | + '\uFF63'; + +UNICODE_CLASS_PF: + '\u00BB' | + '\u2019' | + '\u201D' | + '\u203A' | + '\u2E03' | + '\u2E05' | + '\u2E0A' | + '\u2E0D' | + '\u2E1D' | + '\u2E21'; + +UNICODE_CLASS_PI: + '\u00AB' | + '\u2018' | + '\u201B' | + '\u201C' | + '\u201F' | + '\u2039' | + '\u2E02' | + '\u2E04' | + '\u2E09' | + '\u2E0C' | + '\u2E1C' | + '\u2E20'; + +UNICODE_CLASS_PO: + '\u0021'..'\u0023' | + '\u0025'..'\u0027' | + '\u002A' | + '\u002C' | + '\u002E' | + '\u002F' | + '\u003A' | + '\u003B' | + '\u003F' | + '\u0040' | + '\u005C' | + '\u00A1' | + '\u00A7' | + '\u00B6' | + '\u00B7' | + '\u00BF' | + '\u037E' | + '\u0387' | + '\u055A'..'\u055F' | + '\u0589' | + '\u05C0' | + '\u05C3' | + '\u05C6' | + '\u05F3' | + '\u05F4' | + '\u0609' | + '\u060A' | + '\u060C' | + '\u060D' | + '\u061B' | + '\u061E' | + '\u061F' | + '\u066A'..'\u066D' | + '\u06D4' | + '\u0700'..'\u070D' | + '\u07F7'..'\u07F9' | + '\u0830'..'\u083E' | + '\u085E' | + '\u0964' | + '\u0965' | + '\u0970' | + '\u0AF0' | + '\u0DF4' | + '\u0E4F' | + '\u0E5A' | + '\u0E5B' | + '\u0F04'..'\u0F12' | + '\u0F14' | + '\u0F85' | + '\u0FD0'..'\u0FD4' | + '\u0FD9' | + '\u0FDA' | + '\u104A'..'\u104F' | + '\u10FB' | + '\u1360'..'\u1368' | + '\u166D' | + '\u166E' | + '\u16EB'..'\u16ED' | + '\u1735' | + '\u1736' | + '\u17D4'..'\u17D6' | + '\u17D8'..'\u17DA' | + '\u1800'..'\u1805' | + '\u1807'..'\u180A' | + '\u1944' | + '\u1945' | + '\u1A1E' | + '\u1A1F' | + '\u1AA0'..'\u1AA6' | + '\u1AA8'..'\u1AAD' | + '\u1B5A'..'\u1B60' | + '\u1BFC'..'\u1BFF' | + '\u1C3B'..'\u1C3F' | + '\u1C7E' | + '\u1C7F' | + '\u1CC0'..'\u1CC7' | + '\u1CD3' | + '\u2016' | + '\u2017' | + '\u2020'..'\u2027' | + '\u2030'..'\u2038' | + '\u203B'..'\u203E' | + '\u2041'..'\u2043' | + '\u2047'..'\u2051' | + '\u2053' | + '\u2055'..'\u205E' | + '\u2CF9'..'\u2CFC' | + '\u2CFE' | + '\u2CFF' | + '\u2D70' | + '\u2E00' | + '\u2E01' | + '\u2E06'..'\u2E08' | + '\u2E0B' | + '\u2E0E'..'\u2E16' | + '\u2E18' | + '\u2E19' | + '\u2E1B' | + '\u2E1E' | + '\u2E1F' | + '\u2E2A'..'\u2E2E' | + '\u2E30'..'\u2E39' | + '\u3001'..'\u3003' | + '\u303D' | + '\u30FB' | + '\uA4FE' | + '\uA4FF' | + '\uA60D'..'\uA60F' | + '\uA673' | + '\uA67E' | + '\uA6F2'..'\uA6F7' | + '\uA874'..'\uA877' | + '\uA8CE' | + '\uA8CF' | + '\uA8F8'..'\uA8FA' | + '\uA92E' | + '\uA92F' | + '\uA95F' | + '\uA9C1'..'\uA9CD' | + '\uA9DE' | + '\uA9DF' | + '\uAA5C'..'\uAA5F' | + '\uAADE' | + '\uAADF' | + '\uAAF0' | + '\uAAF1' | + '\uABEB' | + '\uFE10'..'\uFE16' | + '\uFE19' | + '\uFE30' | + '\uFE45' | + '\uFE46' | + '\uFE49'..'\uFE4C' | + '\uFE50'..'\uFE52' | + '\uFE54'..'\uFE57' | + '\uFE5F'..'\uFE61' | + '\uFE68' | + '\uFE6A' | + '\uFE6B' | + '\uFF01'..'\uFF03' | + '\uFF05'..'\uFF07' | + '\uFF0A' | + '\uFF0C' | + '\uFF0E' | + '\uFF0F' | + '\uFF1A' | + '\uFF1B' | + '\uFF1F' | + '\uFF20' | + '\uFF3C' | + '\uFF61' | + '\uFF64' | + '\uFF65'; + +UNICODE_CLASS_PS: + '\u0028' | + '\u005B' | + '\u007B' | + '\u0F3A' | + '\u0F3C' | + '\u169B' | + '\u201A' | + '\u201E' | + '\u2045' | + '\u207D' | + '\u208D' | + '\u2329' | + '\u2768' | + '\u276A' | + '\u276C' | + '\u276E' | + '\u2770' | + '\u2772' | + '\u2774' | + '\u27C5' | + '\u27E6' | + '\u27E8' | + '\u27EA' | + '\u27EC' | + '\u27EE' | + '\u2983' | + '\u2985' | + '\u2987' | + '\u2989' | + '\u298B' | + '\u298D' | + '\u298F' | + '\u2991' | + '\u2993' | + '\u2995' | + '\u2997' | + '\u29D8' | + '\u29DA' | + '\u29FC' | + '\u2E22' | + '\u2E24' | + '\u2E26' | + '\u2E28' | + '\u3008' | + '\u300A' | + '\u300C' | + '\u300E' | + '\u3010' | + '\u3014' | + '\u3016' | + '\u3018' | + '\u301A' | + '\u301D' | + '\uFD3E' | + '\uFE17' | + '\uFE35' | + '\uFE37' | + '\uFE39' | + '\uFE3B' | + '\uFE3D' | + '\uFE3F' | + '\uFE41' | + '\uFE43' | + '\uFE47' | + '\uFE59' | + '\uFE5B' | + '\uFE5D' | + '\uFF08' | + '\uFF3B' | + '\uFF5B' | + '\uFF5F' | + '\uFF62'; + +UNICODE_CLASS_SC: + '\u0024' | + '\u00A2'..'\u00A5' | + '\u058F' | + '\u060B' | + '\u09F2' | + '\u09F3' | + '\u09FB' | + '\u0AF1' | + '\u0BF9' | + '\u0E3F' | + '\u17DB' | + '\u20A0'..'\u20B9' | + '\uA838' | + '\uFDFC' | + '\uFE69' | + '\uFF04' | + '\uFFE0' | + '\uFFE1' | + '\uFFE5' | + '\uFFE6'; + +UNICODE_CLASS_SK: + '\u005E' | + '\u0060' | + '\u00A8' | + '\u00AF' | + '\u00B4' | + '\u00B8' | + '\u02C2'..'\u02C5' | + '\u02D2'..'\u02DF' | + '\u02E5'..'\u02EB' | + '\u02ED' | + '\u02EF'..'\u02FF' | + '\u0375' | + '\u0384' | + '\u0385' | + '\u1FBD' | + '\u1FBF'..'\u1FC1' | + '\u1FCD'..'\u1FCF' | + '\u1FDD'..'\u1FDF' | + '\u1FED'..'\u1FEF' | + '\u1FFD' | + '\u1FFE' | + '\u309B' | + '\u309C' | + '\uA700'..'\uA716' | + '\uA720' | + '\uA721' | + '\uA789' | + '\uA78A' | + '\uFBB2'..'\uFBC1' | + '\uFF3E' | + '\uFF40' | + '\uFFE3'; + +UNICODE_CLASS_SM: + '\u002B' | + '\u003C'..'\u003E' | + '\u007C' | + '\u007E' | + '\u00AC' | + '\u00B1' | + '\u00D7' | + '\u00F7' | + '\u03F6' | + '\u0606'..'\u0608' | + '\u2044' | + '\u2052' | + '\u207A'..'\u207C' | + '\u208A'..'\u208C' | + '\u2118' | + '\u2140'..'\u2144' | + '\u214B' | + '\u2190'..'\u2194' | + '\u219A' | + '\u219B' | + '\u21A0' | + '\u21A3' | + '\u21A6' | + '\u21AE' | + '\u21CE' | + '\u21CF' | + '\u21D2' | + '\u21D4' | + '\u21F4'..'\u22FF' | + '\u2308'..'\u230B' | + '\u2320' | + '\u2321' | + '\u237C' | + '\u239B'..'\u23B3' | + '\u23DC'..'\u23E1' | + '\u25B7' | + '\u25C1' | + '\u25F8'..'\u25FF' | + '\u266F' | + '\u27C0'..'\u27C4' | + '\u27C7'..'\u27E5' | + '\u27F0'..'\u27FF' | + '\u2900'..'\u2982' | + '\u2999'..'\u29D7' | + '\u29DC'..'\u29FB' | + '\u29FE'..'\u2AFF' | + '\u2B30'..'\u2B44' | + '\u2B47'..'\u2B4C' | + '\uFB29' | + '\uFE62' | + '\uFE64'..'\uFE66' | + '\uFF0B' | + '\uFF1C'..'\uFF1E' | + '\uFF5C' | + '\uFF5E' | + '\uFFE2' | + '\uFFE9'..'\uFFEC'; + +UNICODE_CLASS_SO: + '\u00A6' | + '\u00A9' | + '\u00AE' | + '\u00B0' | + '\u0482' | + '\u060E' | + '\u060F' | + '\u06DE' | + '\u06E9' | + '\u06FD' | + '\u06FE' | + '\u07F6' | + '\u09FA' | + '\u0B70' | + '\u0BF3'..'\u0BF8' | + '\u0BFA' | + '\u0C7F' | + '\u0D79' | + '\u0F01'..'\u0F03' | + '\u0F13' | + '\u0F15'..'\u0F17' | + '\u0F1A'..'\u0F1F' | + '\u0F34' | + '\u0F36' | + '\u0F38' | + '\u0FBE'..'\u0FC5' | + '\u0FC7'..'\u0FCC' | + '\u0FCE' | + '\u0FCF' | + '\u0FD5'..'\u0FD8' | + '\u109E' | + '\u109F' | + '\u1390'..'\u1399' | + '\u1940' | + '\u19DE'..'\u19FF' | + '\u1B61'..'\u1B6A' | + '\u1B74'..'\u1B7C' | + '\u2100' | + '\u2101' | + '\u2103'..'\u2106' | + '\u2108' | + '\u2109' | + '\u2114' | + '\u2116' | + '\u2117' | + '\u211E'..'\u2123' | + '\u2125' | + '\u2127' | + '\u2129' | + '\u212E' | + '\u213A' | + '\u213B' | + '\u214A' | + '\u214C' | + '\u214D' | + '\u214F' | + '\u2195'..'\u2199' | + '\u219C'..'\u219F' | + '\u21A1' | + '\u21A2' | + '\u21A4' | + '\u21A5' | + '\u21A7'..'\u21AD' | + '\u21AF'..'\u21CD' | + '\u21D0' | + '\u21D1' | + '\u21D3' | + '\u21D5'..'\u21F3' | + '\u2300'..'\u2307' | + '\u230C'..'\u231F' | + '\u2322'..'\u2328' | + '\u232B'..'\u237B' | + '\u237D'..'\u239A' | + '\u23B4'..'\u23DB' | + '\u23E2'..'\u23F3' | + '\u2400'..'\u2426' | + '\u2440'..'\u244A' | + '\u249C'..'\u24E9' | + '\u2500'..'\u25B6' | + '\u25B8'..'\u25C0' | + '\u25C2'..'\u25F7' | + '\u2600'..'\u266E' | + '\u2670'..'\u26FF' | + '\u2701'..'\u2767' | + '\u2794'..'\u27BF' | + '\u2800'..'\u28FF' | + '\u2B00'..'\u2B2F' | + '\u2B45' | + '\u2B46' | + '\u2B50'..'\u2B59' | + '\u2CE5'..'\u2CEA' | + '\u2E80'..'\u2E99' | + '\u2E9B'..'\u2EF3' | + '\u2F00'..'\u2FD5' | + '\u2FF0'..'\u2FFB' | + '\u3004' | + '\u3012' | + '\u3013' | + '\u3020' | + '\u3036' | + '\u3037' | + '\u303E' | + '\u303F' | + '\u3190' | + '\u3191' | + '\u3196'..'\u319F' | + '\u31C0'..'\u31E3' | + '\u3200'..'\u321E' | + '\u322A'..'\u3247' | + '\u3250' | + '\u3260'..'\u327F' | + '\u328A'..'\u32B0' | + '\u32C0'..'\u32FE' | + '\u3300'..'\u33FF' | + '\u4DC0'..'\u4DFF' | + '\uA490'..'\uA4C6' | + '\uA828'..'\uA82B' | + '\uA836' | + '\uA837' | + '\uA839' | + '\uAA77'..'\uAA79' | + '\uFDFD' | + '\uFFE4' | + '\uFFE8' | + '\uFFED' | + '\uFFEE' | + '\uFFFC' | + '\uFFFD'; + +UNICODE_CLASS_ZL: + '\u2028'; + +UNICODE_CLASS_ZP: + '\u2029'; + +UNICODE_CLASS_ZS: + '\u0020' | + '\u00A0' | + '\u1680' | + '\u180E' | + '\u2000'..'\u200A' | + '\u202F' | + '\u205F' | + '\u3000'; \ No newline at end of file diff --git a/src/main/cpp/test.cpp b/src/main/cpp/test.cpp new file mode 100644 index 00000000..04d0ee3c --- /dev/null +++ b/src/main/cpp/test.cpp @@ -0,0 +1,8 @@ +#include +#include + +#include "top_mcfpp_jni_Test.h" + +JNIEXPORT void JNICALL Java_top_mcfpp_jni_Test_nativeMethod(JNIEnv *, jobject thisObj){ + std::cout << "Hello JNI" << std::endl; +} \ No newline at end of file diff --git a/src/main/java/top/mcfpp/annotations/InsertCommand.java b/src/main/java/top/mcfpp/annotations/InsertCommand.java new file mode 100644 index 00000000..33136baa --- /dev/null +++ b/src/main/java/top/mcfpp/annotations/InsertCommand.java @@ -0,0 +1,11 @@ +package top.mcfpp.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) +@Retention(RetentionPolicy.RUNTIME) +public @interface InsertCommand { +} diff --git a/src/main/java/top/mcfpp/annotations/MCFPPNative.java b/src/main/java/top/mcfpp/annotations/MCFPPNative.java new file mode 100644 index 00000000..bc064875 --- /dev/null +++ b/src/main/java/top/mcfpp/annotations/MCFPPNative.java @@ -0,0 +1,11 @@ +package top.mcfpp.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface MCFPPNative { +} diff --git a/src/main/java/top/mcfpp/jni/Test.java b/src/main/java/top/mcfpp/jni/Test.java new file mode 100644 index 00000000..72573061 --- /dev/null +++ b/src/main/java/top/mcfpp/jni/Test.java @@ -0,0 +1,12 @@ +package top.mcfpp.jni; + +import java.io.File; + +public class Test { + static { + File file = new File("build/dll/native.dll"); + System.load(file.getAbsolutePath()); + } + + public native void nativeMethod(); +} diff --git a/src/main/java/top/mcfpp/lang/MCAnyData.java b/src/main/java/top/mcfpp/lang/MCAnyData.java new file mode 100644 index 00000000..630111ba --- /dev/null +++ b/src/main/java/top/mcfpp/lang/MCAnyData.java @@ -0,0 +1,35 @@ +package top.mcfpp.lang; + +import kotlin.jvm.functions.Function4; +import org.jetbrains.annotations.NotNull; +import top.mcfpp.model.function.Function; +import top.mcfpp.model.function.MNIMethodContainer; +import top.mcfpp.util.ValueWrapper; + +import java.util.HashMap; +import java.util.UUID; + +public class MCAnyData extends MNIMethodContainer { + + static HashMap[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void>> methods; + + static { + methods = new HashMap<>(); + methods.put("toString", (vars, vars2, canSelectMember, varValueWrapper) -> { + //不会有参数 + Function.Companion.addCommand("tellraw @a " + canSelectMember); + return null; + }); + methods.put("getJavaVar", (r, n, caller, re) -> { + //不会有参数 + re.setValue(new JavaVar(caller, UUID.randomUUID().toString())); + return null; + }); + } + + @NotNull + @Override + public Function4[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void> getMNIMethod(@NotNull String name) { + return methods.get(name); + } +} diff --git a/src/main/java/top/mcfpp/lang/MCIntData.java b/src/main/java/top/mcfpp/lang/MCIntData.java new file mode 100644 index 00000000..d0c2bf0f --- /dev/null +++ b/src/main/java/top/mcfpp/lang/MCIntData.java @@ -0,0 +1,33 @@ +package top.mcfpp.lang; + +import kotlin.jvm.functions.Function4; +import org.jetbrains.annotations.NotNull; +import top.mcfpp.model.function.Function; +import top.mcfpp.model.function.MNIMethodContainer; +import top.mcfpp.util.ValueWrapper; + +import java.util.HashMap; + +public class MCIntData extends MNIMethodContainer { + static HashMap[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void>> methods; + + static { + methods = new HashMap<>(); + methods.put("test", (vars, vars2, canSelectMember, varValueWrapper) -> { + //不会有参数 + Function.Companion.addCommand("say " + canSelectMember); + return null; + }); + + methods.put("qwq", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + } + + @NotNull + @Override + public Function4[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void> getMNIMethod(@NotNull String name) { + return methods.get(name); + } +} diff --git a/src/main/java/top/mcfpp/lang/NBTDictionaryData.java b/src/main/java/top/mcfpp/lang/NBTDictionaryData.java new file mode 100644 index 00000000..a01e863f --- /dev/null +++ b/src/main/java/top/mcfpp/lang/NBTDictionaryData.java @@ -0,0 +1,33 @@ +package top.mcfpp.lang; + +import kotlin.jvm.functions.Function4; +import org.jetbrains.annotations.NotNull; +import top.mcfpp.model.function.MNIMethodContainer; +import top.mcfpp.util.ValueWrapper; + +import java.util.HashMap; + +public class NBTDictionaryData extends MNIMethodContainer { + static HashMap[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void>> methods; + + static { + methods = new HashMap<>(); + methods.put("containsKey", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("merge", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("remove", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + } + + @NotNull + @Override + public Function4[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void> getMNIMethod(@NotNull String name) { + return methods.get(name); + } +} diff --git a/src/main/java/top/mcfpp/lang/NBTListConcreteData.java b/src/main/java/top/mcfpp/lang/NBTListConcreteData.java new file mode 100644 index 00000000..1e9c6723 --- /dev/null +++ b/src/main/java/top/mcfpp/lang/NBTListConcreteData.java @@ -0,0 +1,210 @@ +package top.mcfpp.lang; + +import kotlin.jvm.functions.Function4; +import net.querz.nbt.io.SNBTUtil; +import net.querz.nbt.tag.Tag; +import org.jetbrains.annotations.NotNull; +import top.mcfpp.Project; +import top.mcfpp.command.Command; +import top.mcfpp.lang.value.MCFPPValue; +import top.mcfpp.model.function.Function; +import top.mcfpp.model.function.MNIMethodContainer; +import top.mcfpp.util.MacroHelper; +import top.mcfpp.util.NBTUtil; +import top.mcfpp.util.ValueWrapper; + +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Objects; + +public class NBTListConcreteData extends MNIMethodContainer { + + static HashMap[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void>> methods; + + static { + methods = new HashMap<>(); + //list.add(E e) + methods.put("add", (readOnlyArgs, normalArgs, caller, returnVar) -> { + //由于类型检查,必然是可以通过的 + var e = normalArgs[0]; //要添加的成员 + var list = (NBTListConcrete)caller; + if(e instanceof MCFPPValue){ + //都是确定的 + //直接添加值 + list.getValue().add(NBTUtil.INSTANCE.toNBT(e)); + }else { + //e不是确定的,但是list可能是确定的可能不是确定的 + list.toDynamic(true); + String command = ""; + if(e.parentClass() != null) e = e.getTempVar(); + if(list.parentClass() != null){ + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier() + " "; + }else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier() + " "; + } + Function.Companion.addCommand(command); + } + return null; + }); + + //list.addAll(list list) + methods.put("addAll", (readOnlyArgs, normalArgs, caller, returnVar) -> { + var e = (NBTList)normalArgs[0]; //要添加的成员 + var list = (NBTListConcrete)caller; + if(e instanceof MCFPPValue ec){ + //都是确定的 + //直接添加值 + list.getValue().addAll((Collection) ec.getValue()); + }else { + list.toDynamic(true); + String command; + NBTBasedData l; + if(e.parentClass() != null) { + l = (NBTBasedData) e.getTempVar(); + }else{ + l = e; + } + if(list.parentClass() != null){ + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + l.getIdentifier() + "[]"; + }else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + l.getIdentifier() + "[]"; + } + Function.Companion.addCommand(command); + } + return null; + }); + + //list.insert(int index, E e) + methods.put("insert", (readOnlyArgs, normalArgs, caller, returnVar) -> { + //由于类型检查,必然是可以通过的 + var index = (MCInt)normalArgs[0]; //索引 + var e = (Var) normalArgs[1]; //要添加的成员 + var list = (NBTListConcrete)caller; + if(e instanceof MCFPPValue && index instanceof MCIntConcrete indexC){ + //都是确定的 + //直接添加值 + list.getValue().add(Objects.requireNonNull(indexC.getValue()), NBTUtil.INSTANCE.toNBT(e)); + }else if(index instanceof MCIntConcrete indexC){ + //e不是确定的,index是确定的,所以可以直接调用命令而不需要宏 + int i = indexC.getValue(); + list.toDynamic(true); + String command = ""; + if(e.parentClass() != null) e = e.getTempVar(); + if(list.parentClass() != null){ + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "insert " + i + " from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier(); + }else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "insert " + i + " from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier(); + } + Function.Companion.addCommand(command); + }else if(e instanceof MCFPPValue eC){ + //e是确定的,index不是确定的,需要使用宏 + list.toDynamic(true); + Tag tag = NBTUtil.INSTANCE.toNBT(e); + Command command; + try { + if(list.parentClass() != null){ + command = new Command("data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "insert").build("", index.getIdentifier()).build ("value " + SNBTUtil.toSNBT(tag)); + } else { + command = new Command("data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "insert").build("", index.getIdentifier()).build("value " + SNBTUtil.toSNBT(tag)); + } + } catch (IOException ex) { + throw new RuntimeException(ex); + } + var f = MacroHelper.INSTANCE.addMacroCommand(command).build("with storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]"); + Function.Companion.addCommand(f); + } else{ + //e是不确定的,index也不是确定的 + list.toDynamic(true); + if(e.parentClass() != null) e = e.getTempVar(); + Command command; + if(list.parentClass() != null){ + command = new Command("data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "insert").build("", index.getIdentifier()).build ("from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier()); + } else { + command = new Command("data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "insert").build("", index.getIdentifier()).build("from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier()); + } + var f = MacroHelper.INSTANCE.addMacroCommand(command).build("with storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]"); + Function.Companion.addCommand(f); + } + return null; + }); + + methods.put("remove", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("removeAt", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("indexOf", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("lastIndexOf", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("contains", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("clear", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + } + + @NotNull + @Override + public Function4[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void> getMNIMethod(@NotNull String name) { + return methods.get(name); + } +} diff --git a/src/main/java/top/mcfpp/lang/NBTListData.java b/src/main/java/top/mcfpp/lang/NBTListData.java new file mode 100644 index 00000000..5f2a6fa9 --- /dev/null +++ b/src/main/java/top/mcfpp/lang/NBTListData.java @@ -0,0 +1,235 @@ +package top.mcfpp.lang; + +import kotlin.jvm.functions.Function4; +import net.querz.nbt.io.SNBTUtil; +import net.querz.nbt.tag.Tag; +import org.jetbrains.annotations.NotNull; +import top.mcfpp.Project; +import top.mcfpp.command.Command; +import top.mcfpp.lang.value.MCFPPValue; +import top.mcfpp.model.function.Function; +import top.mcfpp.model.function.MNIMethodContainer; +import top.mcfpp.util.MacroHelper; +import top.mcfpp.util.NBTUtil; +import top.mcfpp.util.ValueWrapper; + +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Objects; + +public class NBTListData extends MNIMethodContainer { + + static HashMap[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void>> methods; + + static { + methods = new HashMap<>(); + //list.add(E e) + methods.put("add", (readOnlyArgs, normalArgs, caller, returnVar) -> { + //由于类型检查,必然是可以通过的 + var e = normalArgs[0]; //要添加的成员 + var list = (NBTList)caller; + if(e instanceof MCFPPValue){ + //e是确定的 + Tag tag = NBTUtil.INSTANCE.toNBT(e); + String command; + try{ + if(list.parentClass() != null){ + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "append value " + SNBTUtil.toSNBT(tag); + }else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "append value " + SNBTUtil.toSNBT(tag); + } + }catch (Exception ex){ + throw new RuntimeException(ex); + } + Function.Companion.addCommand(command); + }else { + //e不是确定的 + String command; + if (e.parentClass() != null) e = e.getTempVar(); + if (list.parentClass() != null) { + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier() + " "; + } else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier() + " "; + } + Function.Companion.addCommand(command); + } + return null; + }); + + //list.addAll(list list) + methods.put("addAll", (readOnlyArgs, normalArgs, caller, returnVar) -> { + var e = (NBTList)normalArgs[0]; //要添加的成员 + var list = (NBTList)caller; + String command; + NBTBasedData l; + if(e.parentClass() != null) { + l = (NBTList) e.getTempVar(); + }else if(e instanceof NBTListConcrete eC){ + l = e; + eC.toDynamic(false); + }else{ + l = e; + } + if(list.parentClass() != null){ + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + l.getIdentifier() + "[]"; + }else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "append from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + l.getIdentifier() + "[]"; + } + Function.Companion.addCommand(command); + return null; + }); + + //list.insert(int index, E e) + methods.put("insert", (readOnlyArgs, normalArgs, caller, returnVar) -> { + //由于类型检查,必然是可以通过的 + var index = (MCInt)normalArgs[0]; //索引 + var e = normalArgs[1]; //要添加的成员 + var list = (NBTList)caller; + if(e instanceof MCFPPValue && index instanceof MCIntConcrete indexC){ + //都是确定的 + Tag tag = NBTUtil.INSTANCE.toNBT(e); + int i = indexC.getValue(); + String command; + try { + if (list.parentClass() != null) { + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "insert " + i + " value " + SNBTUtil.toSNBT(tag); + } else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "insert " + i + " value " + SNBTUtil.toSNBT(tag); + } + }catch (IOException ex){ + throw new RuntimeException(ex); + } + Function.Companion.addCommand(command); + }else if(index instanceof MCIntConcrete indexC){ + //e不是确定的,index是确定的,所以可以直接调用命令而不需要宏 + int i = indexC.getValue(); + String command; + if(e.parentClass() != null) e = e.getTempVar(); + if(list.parentClass() != null){ + command = "data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "insert " + i + " from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier(); + }else { + command = "data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "insert " + i + " from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier(); + } + Function.Companion.addCommand(command); + }else if(e instanceof MCFPPValue eC){ + //e是确定的,index不是确定的,需要使用宏 + Tag tag = NBTUtil.INSTANCE.toNBT(e); + Command command; + try { + if(list.parentClass() != null){ + command = new Command("data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "insert ").build("", index.getIdentifier()).build (" value " + SNBTUtil.toSNBT(tag)); + } else { + command = new Command("data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "insert ").build("", index.getIdentifier()).build(" value " + SNBTUtil.toSNBT(tag)); + } + } catch (IOException ex) { + throw new RuntimeException(ex); + } + var f = MacroHelper.INSTANCE.addMacroCommand(command).build("with storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]"); + Function.Companion.addCommand(f); + } else{ + //e是不确定的,index也不是确定的 + if(e.parentClass() != null) e = e.getTempVar(); + Command command; + if(list.parentClass() != null){ + command = new Command("data modify " + + "entity @s " + + "data." + list.getIdentifier() + " " + + "insert ").build("", index.getIdentifier()).build (" from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier()); + } else { + command = new Command("data modify " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + list.getIdentifier() + " " + + "insert ").build("", index.getIdentifier()).build(" from " + + "storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]." + e.getIdentifier()); + } + var f = MacroHelper.INSTANCE.addMacroCommand(command).build("with storage mcfpp:system " + + Project.INSTANCE.getCurrNamespace() + ".stack_frame[" + list.getStackIndex() + "]"); + Function.Companion.addCommand(f); + } + return null; + }); + + methods.put("remove", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("removeAt", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("indexOf", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("lastIndexOf", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("contains", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + + methods.put("clear", (readOnlyArgs, normalArgs, caller, returnVar) -> { + return null; + }); + } + + @NotNull + @Override + public Function4[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void> getMNIMethod(@NotNull String name) { + return methods.get(name); + } +} \ No newline at end of file diff --git a/src/main/java/top/mcfpp/lang/NBTMapData.java b/src/main/java/top/mcfpp/lang/NBTMapData.java new file mode 100644 index 00000000..a391fdab --- /dev/null +++ b/src/main/java/top/mcfpp/lang/NBTMapData.java @@ -0,0 +1,57 @@ +package top.mcfpp.lang; + +import kotlin.jvm.functions.Function4; +import org.jetbrains.annotations.NotNull; +import top.mcfpp.model.function.MNIMethodContainer; +import top.mcfpp.util.ValueWrapper; + +import java.util.HashMap; + +public class NBTMapData extends MNIMethodContainer { + static HashMap[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void>> methods; + + static { + methods = new HashMap<>(); + methods.put("clear", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("containsKey", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("containsValue", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("isEmpty", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("getKeys", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("getValues", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("remove", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("merge", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + + methods.put("size", (vars, vars2, canSelectMember, varValueWrapper) -> { + return null; + }); + } + + @NotNull + @Override + public Function4[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void> getMNIMethod(@NotNull String name) { + return methods.get(name); + } +} diff --git a/src/main/java/top/mcfpp/lang/Range.java b/src/main/java/top/mcfpp/lang/Range.java new file mode 100644 index 00000000..da99ed25 --- /dev/null +++ b/src/main/java/top/mcfpp/lang/Range.java @@ -0,0 +1,31 @@ +package top.mcfpp.lang; +public class Range> { + + /** + * 闭区间左端 + */ + public T start; + + /** + * 闭区间右端 + */ + public T end; + + + /** + * 构造一个区间 + * @param start 区间左端。若为null则没有左端。 + * @param end 区间右端。若为null则没有右端。 + */ + public Range(T start, T end){ + this.start = start; + this.end = end; + } + + + + @Override + public String toString() { + return (start != null ? start : "") + ".." + (end != null ? end : ""); + } +} diff --git a/src/main/java/top/mcfpp/lang/System.java b/src/main/java/top/mcfpp/lang/System.java new file mode 100644 index 00000000..0d10e501 --- /dev/null +++ b/src/main/java/top/mcfpp/lang/System.java @@ -0,0 +1,82 @@ +package top.mcfpp.lang; + +import kotlin.jvm.functions.Function4; +import org.jetbrains.annotations.NotNull; +import top.mcfpp.annotations.InsertCommand; +import top.mcfpp.model.function.Function; +import top.mcfpp.model.function.MNIMethodContainer; +import top.mcfpp.util.NBTUtil; +import top.mcfpp.util.ValueWrapper; + +import java.util.HashMap; +import java.util.UUID; + +public class System extends MNIMethodContainer { + + @NotNull + @Override + public Function4[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void> getMNIMethod(@NotNull String name) { + return methods.get(name); + } + + static HashMap[], Var[], CanSelectMember, ValueWrapper>, java.lang.Void>> methods; + + static { + methods = new HashMap<>(); + methods.put("print", (vars, vars2, canSelectMember, varValueWrapper) -> { + var value = vars2[0]; + //只会有一个参数哦 + if (value instanceof MCInt) print((MCInt) value); + else if (value instanceof MCString) print((MCString) value); + //else if (value instanceof JsonString) print((JsonString) value); + else if (value instanceof NBTBasedData) print((NBTBasedData) value); + else print(value); + return null; + }); + methods.put("typeof", (vars, vars2, canSelectMember, varValueWrapper) -> { + //获取变量 + var value = vars2[0]; + var re = new MCFPPTypeVar(value.getType(), UUID.randomUUID().toString()); + varValueWrapper.setValue(re); + return null; + }); + } + + @InsertCommand + public static void print(@NotNull MCInt var) { + if (var instanceof MCIntConcrete varC) { + //是确定的,直接输出数值 + Function.Companion.addCommand("tellraw @a " + varC.getValue()); + }else { + Function.Companion.addCommand("tellraw @a " + new JsonTextNumber(var).toJson()); + } + } + + //@InsertCommand + //public static void print(JsonString var){ + // Function.Companion.addCommand("tellraw @a " + var.getJsonText().toJson()); + //} + + @InsertCommand + public static void print(@NotNull Var var){ + Function.Companion.addCommand("tellraw @a " + "\"" +var + "\""); + } + + @InsertCommand + public static void print(@NotNull NBTBasedData var){ + if(var instanceof NBTBasedDataConcrete varC){ + Function.Companion.addCommand("tellraw @a " + NBTUtil.INSTANCE.toJava(varC.getValue())); + }else { + //TODO + } + } + + @InsertCommand + public static void print(@NotNull MCString var) { + if(var instanceof MCStringConcrete varC){ + Function.Companion.addCommand("tellraw @a \"" + varC.getValue().getValue() + "\""); + }else{ + //TODO + } + } +} diff --git a/src/main/java/top/mcfppdoc/antlr/McfppDocVisitor.java b/src/main/java/top/mcfppdoc/antlr/McfppDocVisitor.java new file mode 100644 index 00000000..547e4efe --- /dev/null +++ b/src/main/java/top/mcfppdoc/antlr/McfppDocVisitor.java @@ -0,0 +1,6 @@ +package top.mcfppdoc.antlr; + +import top.mcfpp.antlr.mcfppdocBaseVisitor; + +public class McfppDocVisitor extends mcfppdocBaseVisitor { +} diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt deleted file mode 100644 index daeefadf..00000000 --- a/src/main/kotlin/Main.kt +++ /dev/null @@ -1,31 +0,0 @@ -import groovy.lang.GroovyShell -import org.antlr.v4.runtime.CharStreams -import org.antlr.v4.runtime.CommonTokenStream - -fun main(args: Array) { - println("Hello World!") - - //val code = "" - //val input = CharStreams.fromString(code) - //val lexer = mcfppLexer(input) - //val tokens = CommonTokenStream(lexer) - //val parser = mcfppParser(tokens).apply { - // buildParseTree = true - //} - //val tree = parser.compilationUnit() - //val visitor = mcfppBaseVisitor() - //visitor.visit(tree) - - println("Program arguments: ${args.joinToString()}") - evalute(""" - def sayHello(name){ - println "hello "+ name + "." - } - sayHello("MCFPP") - """.trimIndent()) -} - -fun evalute(code:String) { - val shell = GroovyShell() - shell.evaluate(code) -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/MCFPP.kt b/src/main/kotlin/top/alumopper/mcfpp/MCFPP.kt deleted file mode 100644 index 10001332..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/MCFPP.kt +++ /dev/null @@ -1,24 +0,0 @@ -package top.alumopper.mcfpp - -import top.alumopper.mcfpp.io.DatapackCreator -import top.alumopper.mcfpp.lib.* - -/** - * 编译器的启动入口 - */ -fun main(args: Array) { - if (args.size == 1) { - val start: Long = System.currentTimeMillis() - Project.logger.info("Tips: " + UwU.tip) //生成tips - val path = args[0] - Project.init() //初始化 - Project.readProject(path) //读取 - Project.analyse() //解析 - Project.compile() //编译 - Project.optimization() //优化 - Project.genIndex() //生成索引 - //DatapackCreator.createDatapack(Project.root.getAbsolutePath()) //生成数据包 - Project.logger.info("Finished in " + (System.currentTimeMillis() - start) + "ms") - Cache.printAll() - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/Project.kt b/src/main/kotlin/top/alumopper/mcfpp/Project.kt deleted file mode 100644 index 0282dc11..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/Project.kt +++ /dev/null @@ -1,290 +0,0 @@ -package top.alumopper.mcfpp - -import com.alibaba.fastjson2.* -import org.apache.logging.log4j.* -import top.alumopper.mcfpp.io.McfppFileReader -import top.alumopper.mcfpp.lib.* -import java.io.* - -/** - * 一个工程。工程文件包含了这个mcfpp工程编译需要的所有信息。编译器将会以这个文件为入口开始编译。 - * 同时,这个工程文件的名字也是此文件编译生成的数据包的命名空间。 - */ -object Project { - var logger: Logger = LogManager.getLogger("mcfpp") -//TODO config - - /** - * 工程的根目录 - */ - lateinit var root: File - - /** - * 工程的名字 - */ - lateinit var name: String - - /** - * 工程包含的所有文件。以绝对路径保存 - */ - var files: ArrayList = ArrayList() - - /** - * 工程对应的mc版本 - */ - var version: String? = null - - /** - * 数据包的描述。原始Json文本 TODO - */ - var description: String? = null - - /** - * 工程包含的所有引用 - */ - var includes: ArrayList = ArrayList() - - /** - * 编译时,当前编译的文件 - */ - lateinit var currFile: File - - /** - * 当前的命名空间 - */ - lateinit var currNamespace: String - - /** - * 工程中的总错误数量 - */ - var errorCount = 0 - - /** - * 工程中的总警告数量 - */ - var warningCount = 0 - - /** - * 全局缓存 - */ - var global: Global = Global() - fun init() { - global.init() - } - - /** - * 读取工程 - * @param path 工程的json文件的路径 - */ - fun readProject(path: String) { - //工程信息读取 - try { - logger.debug("Reading project from file \"$path\"") - val reader = BufferedReader(FileReader(path)) - val qwq = File(path) - root = qwq.parentFile - name = qwq.name.substring(0, qwq.name.lastIndexOf('.')) - val json: StringBuilder = StringBuilder() - var line: String? - while (reader.readLine().also { line = it } != null) { - json.append(line) - } - val jsonObject: JSONObject = JSONObject.parse(json.toString()) as JSONObject - files = ArrayList() - val filesJson: JSONArray = jsonObject.getJSONArray("files") - for (o in filesJson.toArray()) { - var s = o as String - if (s.endsWith("*")) { - //通配符 - s = s.substring(0, s.length - 1) - } - val r: File = if (s.length > 2 && s[1] == ':') { - //绝对路径 - File(s) - } else { - //相对路径 - File(root.absolutePath + s) - } - logger.info("Finding file in \"" + r.absolutePath + "\"") - getFiles(r, files) - } - version = jsonObject.getString("version") - if (version == null) { - version = "1.20" - } - description = jsonObject.getString("description") - if (description == null) { - description = "A datapack compiled by MCFPP" - } - val includesJson: JSONArray = jsonObject.getJSONArray("includes")?: JSONArray() - for (i in 0 until includesJson.size) { - includes.add(includesJson.getString(i)) - } - } catch (e: Exception) { - logger.error("Error while reading project from file \"$path\"") - errorCount++ - e.printStackTrace() - } - } - - /** - * 解析工程 - */ - fun analyse() { - logger.debug("Analysing project...") - //解析文件 - for (file in files) { - try { - McfppFileReader(file).analyse() - } catch (e: IOException) { - logger.error("Error while analysing file \"$file\"") - errorCount++ - e.printStackTrace() - } - } - } - - /** - * 编译工程 - */ - fun compile() { - //工程文件编译 - //解析文件 - for (file in files) { - logger.debug("Compiling mcfpp code in \"$file\"") - try { - McfppFileReader(file).compile() - } catch (e: IOException) { - logger.error("Error while compiling file \"$file\"") - errorCount++ - e.printStackTrace() - } - } - } - - /** - * 整理并优化工程 - */ - fun optimization() { - logger.debug("Optimizing...") - //寻找入口函数 - var hasEntrance = false - for (f in global.cache.functions) { - if (f.parent.size == 0 && f !is Native) { - //找到了入口函数 - hasEntrance = true - f.commands.add(0, "data modify storage mcfpp:system $name.stack_frame prepend value {}") - logger.debug("Find entrance function:" + (if (f.tag == null) "" else f.tag) + " " + f.name) - } - } - if (!hasEntrance) { - logger.warn("No valid entrance function in Project $name") - warningCount++ - } - logger.info("Complete compiling project " + root.name + " with [" + errorCount + "] error and [" + warningCount + "] warning") - } - - /** - * 生成库索引 - * 在和工程信息json文件的同一个目录下生成一个.mclib文件 - */ - fun genIndex() { - try { - val writer = BufferedWriter(FileWriter(root.absolutePath + "/.mclib")) - writer.write("[function]\n") - for (f in global.cache.functions) { - writer.write(f.namespaceID + "\n") - } - writer.write("[class]\n") - for (c in global.cache.classes.values) { - writer.write(c.namespace.toString() + ":" + c.identifier + "\n") - } - writer.write("[end]\n") - writer.flush() - writer.close() - } catch (e: IOException) { - throw RuntimeException(e) - } - } - - /** - * 获取文件列表 - * @param file 根目录 - * @param files 储存文件用的数组 - */ - private fun getFiles(file: File, files: ArrayList?) { - if (!file.exists()) { - logger.warn("Path \"" + file.absolutePath + "\" doesn't exist. Ignoring.") - warningCount++ - return - } - val fs: Array = file.listFiles() ?: return - for (f in fs) { - if (f.isDirectory) //若是目录,则递归打印该目录下的文件 - getFiles(f, files) - if (f.isFile && f.name.substring(f.name.lastIndexOf(".") + 1) == "mcfpp") { - if (!files!!.contains(f.absolutePath)) { - files.add(f.absolutePath) - } - } - } - } - - /** - * 获取数据包版本 - * @param version 版本字符串 - * @return 版本编号 - */ - fun getVersion(version: String): Int { - return when (version) { - "1.20" -> { - 13 - } - - "1.19.4" -> { - 12 - } - - "23w03a" -> { - 11 - } - - "1.19.3", "1.19.2", "1.19.1", "1.19" -> { - 10 - } - - "1.18.2" -> { - 9 - } - - "1.18.1", "1.18" -> { - 8 - } - - "1.17.1", "1.17" -> { - 7 - } - - "1.16.5", "1.16.4", "1.16.3", "1.16.2" -> { - 6 - } - - "1.16.1", " 1.16", "1.15.2", "1.15.1", "1.15" -> { - 5 - } - - "1.14.4", "1.14.3", "1.14.2", "1.14.1", "1.14", "1.13.2", "1.13.1", "1.13" -> { - 4 - } - - "17w43a" -> { - 3 - } - - else -> { - logger.warn("Unknown version: \"$version\". Using 1.20 (13)") - 13 - } - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/command/Commands.kt b/src/main/kotlin/top/alumopper/mcfpp/command/Commands.kt deleted file mode 100644 index 22e5867e..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/command/Commands.kt +++ /dev/null @@ -1,33 +0,0 @@ -package top.alumopper.mcfpp.command - -import top.alumopper.mcfpp.lib.Function -import java.util.* -import top.alumopper.mcfpp.lang.MCInt - -/** - * 命令总类,提供了大量用于生成命令的方法,避免频繁的新建类(调用命令类的各种极度抽象的构造方法(x - * 尽量不要打开或编辑这个文件,不然会感受痛苦。 - * 尽量少地使用这个文件中的内容 - */ -@Deprecated("") -object Commands { - fun Function(function: Function): String { - return "function " + function.namespaceID.lowercase(Locale.getDefault()) - } - - fun SbPlayerAdd(target: MCInt, value: Int): String { - return "scoreboard players add " + target.identifier + " " + target.`object` + " " + value - } - - fun SbPlayerOperation(a: MCInt, operation: String, b: MCInt): String { - return "scoreboard players operation " + a.identifier + " " + a.`object` + " " + operation + " " + b.identifier + " " + b.`object` - } - - fun SbPlayerRemove(target: MCInt, value: Int): String { - return "scoreboard players remove " + target.identifier + " " + target.`object` + " " + value - } - - fun SbPlayerSet(a: MCInt, value: Int): String { - return "scoreboard players set " + a.identifier + " " + a.`object` + " " + value - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/command/package-info.kt b/src/main/kotlin/top/alumopper/mcfpp/command/package-info.kt deleted file mode 100644 index df744259..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/command/package-info.kt +++ /dev/null @@ -1,5 +0,0 @@ -/** - * 命令部分。 - */ -package top.alumopper.mcfpp.command - diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/ArgumentNotMatchException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/ArgumentNotMatchException.kt deleted file mode 100644 index 95ac94d1..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/ArgumentNotMatchException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当参数不正确时抛出此异常。例如参数类型错误,参数数量不匹配等。 - */ -class ArgumentNotMatchException(s: String?) : RuntimeException(s) \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/ClassDuplicationException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/ClassDuplicationException.kt deleted file mode 100644 index fd792956..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/ClassDuplicationException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 类重复定义 - */ -class ClassDuplicationException : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/ConstChangeException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/ConstChangeException.kt deleted file mode 100644 index ef6aa02f..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/ConstChangeException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当尝试改变一个常量时发生。 - */ -class ConstChangeException : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/ExecuteCommandListEndException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/ExecuteCommandListEndException.kt deleted file mode 100644 index dc43c8a0..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/ExecuteCommandListEndException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当execute命令已经结束时(最后一个子命令为run),仍然尝试添加子命令时抛出异常 - */ -class ExecuteCommandListEndException(message: String?) : RuntimeException(message) \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/FunctionDuplicationException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/FunctionDuplicationException.kt deleted file mode 100644 index c1644861..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/FunctionDuplicationException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当一个函数被重复定义时抛出此异常 - */ -class FunctionDuplicationException : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/FunctionNotDefineException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/FunctionNotDefineException.kt deleted file mode 100644 index 05b3fa7f..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/FunctionNotDefineException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 函数未定义 - */ -class FunctionNotDefineException : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/IllegalFormatException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/IllegalFormatException.kt deleted file mode 100644 index 062a39f0..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/IllegalFormatException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当出现非法的格式时抛出此异常 - */ -class IllegalFormatException(msg: String?) : RuntimeException(msg) \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/IllegalFunctionNameException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/IllegalFunctionNameException.kt deleted file mode 100644 index 80b48c28..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/IllegalFunctionNameException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当函数名字非法时抛出此异常 - */ -class IllegalFunctionNameException(s: String?) : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/SyntaxException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/SyntaxException.kt deleted file mode 100644 index 9920215b..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/SyntaxException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 用于编译器发现语法出错时。 - */ -class SyntaxException : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/TODOException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/TODOException.kt deleted file mode 100644 index 59e8405b..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/TODOException.kt +++ /dev/null @@ -1,8 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当编译器意外进入未完成的区域,即被`//TODO`标记的区域时抛出。 - * 这样做的目的是更好的观察到底程序在哪里进入了错误的区域,而不是单纯地 - * 返回一个null,导致后续程序出现[NullPointerException] - */ -class TODOException(msg: String?) : RuntimeException(msg) \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/VariableConverseException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/VariableConverseException.kt deleted file mode 100644 index f3292d09..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/VariableConverseException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 当变量不能无法进行隐式类型转换时抛出 - */ -class VariableConverseException : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/VariableDuplicationException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/VariableDuplicationException.kt deleted file mode 100644 index 4c7cc5cf..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/VariableDuplicationException.kt +++ /dev/null @@ -1,9 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 变量重复声明 - */ -class VariableDuplicationException : RuntimeException { - constructor() : super() - constructor(message: String?) : super(message) -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/VariableNotDefineException.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/VariableNotDefineException.kt deleted file mode 100644 index 6bbecfe8..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/VariableNotDefineException.kt +++ /dev/null @@ -1,6 +0,0 @@ -package top.alumopper.mcfpp.exception - -/** - * 变量未声明 - */ -class VariableNotDefineException : RuntimeException() \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/exception/package-info.kt b/src/main/kotlin/top/alumopper/mcfpp/exception/package-info.kt deleted file mode 100644 index dc7578b7..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/exception/package-info.kt +++ /dev/null @@ -1,10 +0,0 @@ -/** - * - * - * 此包中包含了mcfpp编译器在编译过程中会遇到的各种异常,例如变量未定义,变量重复定义,等等。 - * 此包中的所有异常都应该继承于[java.lang.RuntimeException],避免强制try-catch的 - * 使用。 - * - */ -package top.alumopper.mcfpp.exception - diff --git a/src/main/kotlin/top/alumopper/mcfpp/io/DatapackCreator.kt b/src/main/kotlin/top/alumopper/mcfpp/io/DatapackCreator.kt deleted file mode 100644 index f7596d19..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/io/DatapackCreator.kt +++ /dev/null @@ -1,141 +0,0 @@ -package top.alumopper.mcfpp.io - -import com.alibaba.fastjson2.JSON -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.lib.* -import java.io.* -import java.nio.file.* - -/** - * 用于创建一个数据包的框架。 - * 一个完整的数据包包含(加粗者为重要组成部分,也是默认包含的部分): - * - * * **进度(advancement)** - * * 聊天类型(chat_type) - * * 数据包(datapacks) - * * **函数(functions)** - * * **战利品表(loot_tables)** - * * **谓词(predicates)** - * * 结构(structures) - * * 配方(recipes) - * * **物品修饰器(item_modifiers)** - * * **标签(tags)** - * * 维度(dimension) - * * 维度类型(dimension_type) - * * 世界生成(worldgen) - * - * 加粗的部分表示对一般数据包的逻辑实现几乎必不可少的部分。 - */ -object DatapackCreator { - /** - * TODO - * 在指定的路径生成一个数据包的框架 - * @param path 路径 - */ - fun createDatapack(path: String) { - Project.logger.debug("Clearing output folder...") - //清空原输出文件夹 - delAllFile(File("$path/out")) - Project.logger.debug("Creating datapack...") - //生成 - val datapackMcMeta = DatapackMcMeta( - DatapackMcMeta.Pack( - Project.getVersion(Project.version!!), - Project.description!! - ) - ) - val datapackMcMetaJson: String = JSON.toJSONString(datapackMcMeta) - //创建文件夹 - try { - Files.createDirectories(Paths.get("$path/out/data")) - //创建pack.mcmeta - Files.write(Paths.get("$path/out/pack.mcmeta"), datapackMcMetaJson.toByteArray()) - //写入函数文件 - for (f in Project.global.cache!!.functions) { - if (f is Native) { - continue - } - Project.logger.debug("Writing File: " + path + "/out/data/" + f.namespace + "/functions/" + f.name + ".mcfunction") - Files.createDirectories(Paths.get(path + "/out/data/" + f.namespace + "/functions")) - Files.write( - Paths.get(path + "/out/data/" + f.namespace + "/functions/" + f.name + ".mcfunction"), - f.cmdStr.toByteArray() - ) - } - //写入类的函数文件 - for (cls in Project.global.cache!!.classes.values) { - if (cls is Native) { - continue - } - //成员 - for (f in cls.cache!!.functions) { - if (f is Native) { - continue - } - Project.logger.debug("Writing File: " + path + "/out/data/" + cls.namespace + "/functions/" + cls.identifier + "/" + f.name + ".mcfunction") - Files.createDirectories(Paths.get(path + "/out/data/" + cls.namespace + "/functions/" + cls.identifier)) - Files.write( - Paths.get(path + "/out/data/" + cls.namespace + "/functions/" + cls.identifier + "/" + f.name + ".mcfunction"), - f.cmdStr.toByteArray() - ) - } - //静态 - for (f in cls.staticCache!!.functions) { - if (f is Native) { - continue - } - Project.logger.debug("Writing File: " + path + "/out/data/" + cls.namespace + "/functions/" + cls.identifier + "/static/" + f.name + ".mcfunction") - Files.createDirectories(Paths.get(path + "/out/data/" + f.namespace + "/functions/" + cls.identifier + "/static")) - Files.write( - Paths.get(path + "/out/data/" + cls.namespace + "/functions/" + cls.identifier + "/static/" + f.name + ".mcfunction"), - f.cmdStr.toByteArray() - ) - } - } - //写入标签json文件 - for (tag in Project.global.functionTags!!.values) { - Project.logger.debug("Writing File: " + path + "/out/data/" + tag.namespace + "/tags/functions/" + tag.tag + ".json") - Files.write( - Paths.get(path + "/out/data/" + tag.namespace + "/tags/functions/" + tag.tag + ".json"), - tag.tagJSON.toByteArray() - ) - } - } catch (e: IOException) { - throw RuntimeException(e) - } - } - - /** - * 删除文件或文件夹 - * @param directory 文件或文件夹 - */ - private fun delAllFile(directory: File) { - if (!directory.isDirectory) { - directory.delete() - } else { - val files: Array? = directory.listFiles() - - // 空文件夹 - if (files!!.isEmpty()) { - directory.delete() - return - } - - // 删除子文件夹和子文件 - for (file in files) { - if (file.isDirectory) { - delAllFile(file) - } else { - file.delete() - } - } - - // 删除文件夹本身 - directory.delete() - } - } - - internal class DatapackMcMeta(var pack: Pack) { - internal class Pack(var pack_format: Int, var description: String) - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/io/McfppFileReader.kt b/src/main/kotlin/top/alumopper/mcfpp/io/McfppFileReader.kt deleted file mode 100644 index 612ecf9e..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/io/McfppFileReader.kt +++ /dev/null @@ -1,96 +0,0 @@ -package top.alumopper.mcfpp.io - -import mcfppLexer -import mcfppParser -import org.antlr.v4.runtime.* -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.lib.* -import java.io.* - -/** - * 用于读取和分析mcfpp代码。 - */ -class McfppFileReader(path: String?) : McfppReader() { - /** - * 从指定路径读取mcfpp文件 - * @param path mcfpp文件的路径 - */ - init { - this.path = path - rpath = getRelativePath(Project.root!!.absolutePath, File(path!!).parentFile.absolutePath) - currPath = rpath - input = FileInputStream(path) - } - - /** - * 解析这个文件 - */ - @Throws(IOException::class) - fun analyse() { - Project.currNamespace = Project.name - Project.currFile = File(path!!) - val charStream: CharStream = CharStreams.fromStream(input) - val tokens = CommonTokenStream(mcfppLexer(charStream)) - McfppFileVisitor().visit(mcfppParser(tokens).compilationUnit()) - } - - /** - * 编译这个文件 - */ - @Throws(IOException::class) - fun compile() { - Project.currNamespace = Project.name - Project.currFile = File(path!!) - val charStream: CharStream = CharStreams.fromStream(input) - val lexer = mcfppLexer(charStream) - val tokens = CommonTokenStream(lexer) - val parser = mcfppParser(tokens) - parser.addParseListener(McfppImListener()) - parser.compilationUnit() - } - - companion object { - /** - * 当前McfppFileReader读取的文件的相对路径 - */ - var currPath: String? = null - - /** - * 获得targetPath相对于sourcePath的相对路径 - * @param sourcePath : 原文件路径 - * @param targetPath : 目标文件路径 - * @return 返回相对路径 - */ - private fun getRelativePath(sourcePath: String, targetPath: String): String { - val pathSB: StringBuilder = StringBuilder() - if (targetPath.indexOf(sourcePath) == 0) { - pathSB.append(targetPath.replace(sourcePath, "")) - } else { - val sourcePathArray: List = sourcePath.split("/") - val targetPathArray: List = targetPath.split("/") - if (targetPathArray.size >= sourcePathArray.size) { - var i = 0 - while (i < targetPathArray.size) { - if (!(sourcePathArray.size > i && targetPathArray[i] == sourcePathArray[i])) { - pathSB.append("../".repeat(0.coerceAtLeast(sourcePathArray.size - i))) - while (i < targetPathArray.size) { - pathSB.append(targetPathArray[i]).append("/") - i++ - } - break - } - i++ - } - } else { - for (i in sourcePathArray.indices) { - if (!(targetPathArray.size > i && targetPathArray[i] == sourcePathArray[i])) { - pathSB.append("../".repeat(sourcePathArray.size - i)) - break - } - } - } - } - return pathSB.toString() - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/io/McfppReader.kt b/src/main/kotlin/top/alumopper/mcfpp/io/McfppReader.kt deleted file mode 100644 index 9a32fa9c..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/io/McfppReader.kt +++ /dev/null @@ -1,25 +0,0 @@ -package top.alumopper.mcfpp.io - -import java.io.InputStream - -abstract class McfppReader { - /** - * 用于读取用的流 - */ - var input: InputStream? = null - - /** - * 行数定位 - */ - var line = 0 - - /** - * 对应的文件绝对路径 - */ - var path: String? = null - - /** - * 文件相对根目录的路径 - */ - var rpath: String? = null -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/CanSelectMember.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/CanSelectMember.kt deleted file mode 100644 index aacef5be..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/CanSelectMember.kt +++ /dev/null @@ -1,13 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.lib.Function -import top.alumopper.mcfpp.lib.Class - -/** - * 实现此接口即代表这个Java类所代表的类型能够从这个类型的变量中搜寻此变量所代表的mcfpp类的成员。 - */ -interface CanSelectMember { - fun getVarMember(key: String?): Var? - fun getFunctionMember(key: String?, params: List?): Function? - fun Class(): Class? -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/ClassObject.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/ClassObject.kt deleted file mode 100644 index 45d9733f..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/ClassObject.kt +++ /dev/null @@ -1,96 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.exception.VariableConverseException -import top.alumopper.mcfpp.lib.* -import top.alumopper.mcfpp.lib.Function -import java.util.* - -/** - * 一个类的实例 - */ -open class ClassObject : Var, CanSelectMember { - /** - * 它的类型 - */ - var clsType: Class - - /** - * 类的字符串标识符 - */ - @get:Override - override var type: String - - /** - * 在模拟堆中的地址 - */ - var address: MCInt? = null - - /** - * 类中的成员 - */ - var cache: Cache? = null - - /** - * 初始化类实例的时候自动生成的临时指针 - */ - var initPointer: ClassPointer - - constructor(cls: Class) : super() { - this.clsType = cls - type = cls.identifier - initPointer = ClassPointer(cls, cls, UUID.randomUUID().toString()) - initPointer.address = (MCInt().setObj(cls.addressSbObject) as MCInt) - initPointer.obj = this - } - - constructor(cls: Class, container: CacheContainer, identifier: String) { - this.clsType = cls - type = cls.identifier - key = identifier - this.identifier = container.prefix + identifier - initPointer = ClassPointer(cls, cls, UUID.randomUUID().toString()) - initPointer.address = (MCInt().setObj(cls.addressSbObject) as MCInt) - initPointer.obj = this - } - - - constructor(classObject: ClassObject) : super(classObject) { - this.clsType = classObject.clsType - initPointer = classObject.initPointer - address = classObject.address - type = classObject.type - cache = classObject.cache - } - - val tag: String - /** - * 获取这个类的实例的指针实体在mcfunction中拥有的tag - * @return 返回它的tag - */ - get() = clsType.namespace + "_class_" + clsType.identifier + "_pointer" - - @Override - @Throws(VariableConverseException::class) - override fun assign(b: Var?) { - } - - @Override - override fun cast(type: String): Var? { - return null - } - - @Override - override fun clone(): Any { - return "null" - } - - @Override - override fun getVarMember(key: String?): Var? { - return null - } - - @Override - override fun getFunctionMember(key: String?, params: List?): Function? { - return null - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/ClassPointer.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/ClassPointer.kt deleted file mode 100644 index d1e5ed61..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/ClassPointer.kt +++ /dev/null @@ -1,134 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.exception.TODOException -import top.alumopper.mcfpp.exception.VariableConverseException -import top.alumopper.mcfpp.lib.Function -import top.alumopper.mcfpp.lib.* - -/** - * 一个类的实例的指针.它指向了一个类的对象 - */ -class ClassPointer : Var, CanSelectMember { - /** - * 指针的类型 - */ - var clsType: Class - - /** - * 指针的类的标识符 - */ - override var type: String - - /** - * 指针指向的类的实例 - */ - var obj: ClassObject? = null - - /** - * 指针的地址 - */ - var address: MCInt - - /** - * 创建一个指针 - * @param type 指针的类型 - * @param container 容器,生成前缀用 - * @param identifier 标识符 - */ - constructor(type: Class, container: CacheContainer, identifier: String) { - clsType = type - this.type = clsType.identifier - key = identifier - this.identifier = container.prefix + identifier - address = - MCInt(Function.currFunction!!.namespace + "_class_" + type.identifier + "_pointer_" + identifier).setObj( - type.addressSbObject - ) as MCInt - } - - - constructor(classPointer: ClassPointer) : super(classPointer) { - clsType = classPointer.clsType - type = classPointer.type - obj = classPointer.obj - address = classPointer.address - } - - /** - * 将b中的值赋值给此变量。一个指针只能指向它的类型的类或者其子类的实例 - * @param b 变量的对象 - * @throws VariableConverseException 如果隐式转换失败 - */ - @Override - @Throws(VariableConverseException::class) - override fun assign(b: Var?) { - if (b is ClassObject) { - if (!b.clsType.canCastTo(clsType)) { - throw VariableConverseException() - } - if (obj != null) { - //原实体中的实例减少一个指针 - Function.addCommand( - "execute " + - "as @e[tag=" + obj!!.clsType.namespace + "_class_" + obj!!.clsType.identifier + "_pointer] " + - "if score @s " + obj!!.address!!.`object`.name + " = " + address.identifier + " " + address.`object`.name + " " + - "run data remove entity @s data.pointers[0]" - ) - } - obj = b - //地址储存 - address.assign(b.address) - //实例中的指针列表 - Function.addCommand( - "execute " + - "as @e[tag=" + obj!!.clsType.namespace + "_class_" + obj!!.clsType.identifier + "_pointer] " + - "if score @s " + b.address!!.`object`.name + " = " + address.identifier + " " + address.`object`.name + " " + - "run data modify entity @s data.pointers append value 0" - ) - } - if (b is ClassPointer) { - if (!b.clsType.canCastTo(clsType)) { - throw VariableConverseException() - } - if (obj != null) { - //原实体中的实例减少一个指针 - Function.addCommand( - "execute " + - "as @e[tag=" + obj!!.clsType.namespace + "_class_" + obj!!.clsType.identifier + "_pointer] " + - "if score @s " + obj!!.address!!.`object`.name + " = " + address.identifier + " " + address.`object`.name + " " + - "run data remove entity @s data.pointers[0]" - ) - } - obj = b.obj - //地址储存 - address.assign(b.address) - //实例中的指针列表 - Function.addCommand( - "execute " + - "as @e[tag=" + obj!!.clsType.namespace + "_class_" + obj!!.clsType.identifier + "_pointer] " + - "if score @s " + b.address.`object`.name + " = " + address.identifier + " " + address.`object`.name + " " + - "run data modify entity @s data.pointers append value 0" - ) - } - } - - @Override - override fun cast(type: String): Var? { - return null - } - - @Override - override fun clone(): Any { - throw TODOException("") - } - - @Override - override fun getVarMember(key: String?): Var? { - return null - } - - @Override - override fun getFunctionMember(key: String?, params: List?): Function? { - return null - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/ClassType.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/ClassType.kt deleted file mode 100644 index 6fea60e8..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/ClassType.kt +++ /dev/null @@ -1,53 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.exception.TODOException -import top.alumopper.mcfpp.exception.VariableConverseException -import top.alumopper.mcfpp.lib.Function -import top.alumopper.mcfpp.lib.Class - -/** - * ClassType代表了一种类,它仅仅用于编译过程中。通过此类可以获取它代表的类的静态成员。 - */ -class ClassType: ClassObject, CanSelectMember { - - constructor(cls: Class) : super(cls) - - @get:Override - override var isStatic: Boolean - get() = true - set(isStatic) { - super.isStatic = isStatic - } - - @Override - override fun clone(): Any { - throw TODOException("") - } - - @get:Override - override var type: String - get() = "ClassType" - set(type) { - super.type = type - } - - @Override - @Throws(VariableConverseException::class) - override fun assign(b: Var?) { - } - - @Override - override fun cast(type: String): Var? { - return null - } - - @Override - override fun getVarMember(key: String?): Var? { - return null - } - - @Override - override fun getFunctionMember(key: String?, params: List?): Function? { - return null - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/Entity.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/Entity.kt deleted file mode 100644 index f28e1104..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/Entity.kt +++ /dev/null @@ -1,3 +0,0 @@ -package top.alumopper.mcfpp.lang - -class Entity \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/JsonText.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/JsonText.kt deleted file mode 100644 index b9ed1280..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/JsonText.kt +++ /dev/null @@ -1,3 +0,0 @@ -package top.alumopper.mcfpp.lang - -class JsonText \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/MCBool.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/MCBool.kt deleted file mode 100644 index 07825038..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/MCBool.kt +++ /dev/null @@ -1,226 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.exception.VariableConverseException -import top.alumopper.mcfpp.lib.* -import java.util.* -import top.alumopper.mcfpp.lib.Function - -class MCBool : Var, OnScoreboard { - var value = false - var boolObject: SbObject = SbObject.MCS_boolean - - constructor(id: String, curr: CacheContainer) { - key = id - identifier = curr.prefix + "_" + id - } - - constructor(b: Boolean, id: String, curr: CacheContainer) : this(id, curr) { - value = b - isConcrete = true - } - - constructor(id: String) { - key = id - identifier = id - } - - constructor() : this(UUID.randomUUID().toString()) { - isTemp = true - } - - constructor(b: MCBool) : super(b) { - this.value = b.value; - this.boolObject = b.boolObject; - } - - constructor(b: Boolean) : this(UUID.randomUUID().toString()) { - isTemp = true - isConcrete = true - value = b - } - @get:Override - override val type: String - get() = "bool" - - @Override - override fun assign(b: Var?) { - if (b is MCBool) { - assignCommand(b) - } else { - throw VariableConverseException() - } - } - - @Override - override fun cast(type: String): Var? { - return if (type == this.type) { - this - } else null - } - - fun equalCommand(a: MCBool): MCBool { - //re = t == a - val re: MCBool - if (isConcrete && a.isConcrete) { - re = MCBool(Objects.equals(value, a.value)) - } else if (isConcrete) { - re = a.equalCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq = owo owo - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " if score " + identifier + " " + boolObject + " matches " + if (a.value) 1 else 0 - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " if score " + identifier + " " + boolObject + " = " + a.identifier + " " + a.boolObject - ) - } - return re - } - - fun notEqualCommand(a: MCBool): MCBool { - //re = t != a - val re: MCBool - if (isConcrete && a.isConcrete) { - re = MCBool(!Objects.equals(value, a.value)) - } else if (isConcrete) { - re = a.equalCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq = owo owo - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " unless score " + identifier + " " + boolObject + " matches " + if (a.value) 1 else 0 - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " unless score " + identifier + " " + boolObject + " = " + a.identifier + " " + a.boolObject - ) - } - return re - } - - fun opposeCommand(): MCBool { - val re: MCBool - if (isConcrete) { - if (isTemp) { - value = !value - re = this - } else { - re = MCBool(!value) - } - } else { - if (isTemp) { - Function.addCommand( - "execute store success score " + identifier + " " + boolObject - + " if score " + identifier + " " + boolObject + " matches " + 0 - ) - re = this - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " if score " + identifier + " " + boolObject + " matches " + 0 - ) - } - } - return re - } - - fun orCommand(a: MCBool): MCBool { - val re: MCBool - if (isConcrete && a.isConcrete) { - re = MCBool(value || a.value) - } else if (isConcrete) { - re = a.orCommand(this) - } else if (a.isConcrete) { - if (a.value) { - re = MCBool(true) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " if score " + identifier + " " + boolObject + " matches " + 1 - ) - } - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " if score " + identifier + " " + boolObject + " matches " + 1 - ) - Function.addCommand( - "execute" + - " if score " + re.identifier + " " + re.boolObject + " matches " + 0 + - " store success score " + re.identifier + " " + re.boolObject + - " if score " + a.identifier + " " + a.boolObject + " matches " + 1 - ) - } - return re - } - - fun andCommand(a: MCBool): MCBool { - val re: MCBool - if (isConcrete && a.isConcrete) { - re = MCBool(value && a.value) - } else if (isConcrete) { - re = a.andCommand(this) - } else if (a.isConcrete) { - if (!a.value) { - re = MCBool(false) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " if score " + identifier + " " + boolObject + " matches " + 1 - ) - } - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + re.boolObject - + " if score " + identifier + " " + boolObject + " matches " + 1 - ) - Function.addCommand( - "execute" + - " if score " + re.identifier + " " + re.boolObject + " matches " + 1 + - " store success score " + re.identifier + " " + re.boolObject + - " if score " + a.identifier + " " + a.boolObject + " matches " + 1 - ) - } - return re - } - - fun assignCommand(a: MCBool) { - if (a.isConcrete) { - isConcrete = true - value = true - } else { - isConcrete = false - //变量进栈 - Function.addCommand( - "execute" + - " store result storage mcfpp:system " + Project.name + ".stack_frame[" + stackIndex + "]." + key + - " run scoreboard players operation " + identifier + " " + boolObject + " = " + a.identifier + " " + a.boolObject - ) - } - } - - @Override - override fun clone(): MCBool { - return MCBool(this) - } - - @Override - override fun setObj(sbObject: SbObject): MCBool { - boolObject = sbObject - return this - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/MCInt.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/MCInt.kt deleted file mode 100644 index d4353123..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/MCInt.kt +++ /dev/null @@ -1,403 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.command.Commands -import top.alumopper.mcfpp.exception.VariableConverseException -import top.alumopper.mcfpp.lib.CacheContainer -import top.alumopper.mcfpp.lib.Function -import java.util.* - -/** - * 代表了mc中的一个整数。实质上是记分板中的一个记分项。 - */ -class MCInt : Number { - /** - * 创建一个匿名的动态int - */ - constructor() : this(UUID.randomUUID().toString()) { - isTemp = true - } - - /** - * 创建一个固定的匿名int - * @param value 值 - */ - constructor(value: Int) : this(UUID.randomUUID().toString()) { - isTemp = true - isConcrete = true - this.value = value - } - - /** - * 创建一个固定的int - * @param id 标识符 - * @param value 值 - */ - constructor(id: String, value: Int) : super( - Function.currFunction!!.namespaceID + "_" + id - ) { - key = id - isConcrete = true - this.value = value - } - - /** - * 创建一个int - * @param id 值 - * @param curr 这边变量被储存在的缓存。用于命名。 - */ - constructor(id: String, curr: CacheContainer) : super(curr.prefix + id) { - key = id - } - - /** - * 创建一个int值。它的key和identifier相同。 - * @param id identifier - */ - constructor(id: String) : super(id) { - key = id - } - - /** - * 复制一个int - * @param b 被复制的int值 - */ - constructor(b: MCInt) : super(b) { - } - - @get:Override - override val type: String - get() = "int" - - @Override - @Throws(VariableConverseException::class) - override fun assign(b: Var?) { - if (b is MCInt) { - assignCommand(b) - } else { - throw VariableConverseException() - } - } - - @Override - override fun cast(type: String): Var? { - return if (type == this.type) { - this - } else null - } - - @Override - override fun assignCommand(a: Number) { - //t = a - if (a.isConcrete) { - isConcrete = true - value = a.value - } else { - isConcrete = false - //变量进栈 - Function.addCommand( - "execute store result storage mcfpp:system " + Project.name + ".stack_frame[" + stackIndex + "]." + key + " run " - + Commands.SbPlayerOperation(this, "=", a as MCInt) - ) - } - } - - @Override - override fun addCommand(a: Number): Number { - //re = t + a - var re = MCInt() - if (a.isConcrete) { - if (isConcrete) { - re.value = value!! + a.value!! - re.isConcrete = true - } else { - if (!isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", this)) - } else { - re = this - } - Function.addCommand(Commands.SbPlayerAdd(re, a.value!!)) - } - } else { - if (isConcrete) { - if (!a.isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", a as MCInt)) - } else { - re = a as MCInt - } - Function.addCommand(Commands.SbPlayerAdd(re, value!!)) - } else { - if (!a.isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", a as MCInt)) - } else { - re = a as MCInt - } - Function.addCommand(Commands.SbPlayerOperation(re, "+=", this)) - } - } - return re - } - - @Override - override fun minusCommand(a: Number): Number { - //re = t - a - var re = MCInt() - if (a.isConcrete) { - if (isConcrete) { - re.value = value!! - a.value!! - re.isConcrete = true - } else { - if (!isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", this)) - } else { - re = this - } - Function.addCommand(Commands.SbPlayerRemove(re, a.value!!)) - } - } else { - if (isConcrete) { - if (!a.isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", a as MCInt)) - } else { - re = a as MCInt - } - Function.addCommand(Commands.SbPlayerRemove(re, value!!)) - } else { - if (!a.isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", a as MCInt)) - } else { - re = a as MCInt - } - Function.addCommand(Commands.SbPlayerOperation(re, "-=", this)) - } - } - return re - } - - @Override - override fun multipleCommand(a: Number): Number { - //re = t * a - var re = MCInt() - if (a.isConcrete && isConcrete) { - re.value = value!! * a.value!! - re.isConcrete = true - } else { - if (a.isConcrete) { - Function.addCommand(Commands.SbPlayerSet(a as MCInt, a.value!!)) - } - if (isConcrete) { - Function.addCommand(Commands.SbPlayerSet(this, value!!)) - } - if (!isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", this)) - } else { - re = this - } - Function.addCommand(Commands.SbPlayerOperation(re, "*=", a as MCInt)) - } - return re - } - - @Override - override fun divideCommand(a: Number): Number { - //re = t / a - var re = MCInt() - if (a.isConcrete && isConcrete) { - re.value = value!! / a.value!! - re.isConcrete = true - } else { - if (a.isConcrete) { - Function.addCommand(Commands.SbPlayerSet(a as MCInt, a.value!!)) - } - if (isConcrete) { - Function.addCommand(Commands.SbPlayerSet(this, value!!)) - } - if (!isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", this)) - } else { - re = this - } - Function.addCommand(Commands.SbPlayerOperation(re, "/=", a as MCInt)) - } - return re - } - - @Override - override fun modularCommand(a: Number): Number { - //re = t / a - var re = MCInt() - if (a.isConcrete && isConcrete) { - re.value = value!! % a.value!! - re.isConcrete = true - } else { - if (a.isConcrete) { - Function.addCommand(Commands.SbPlayerSet(a as MCInt, a.value!!)) - } - if (isConcrete) { - Function.addCommand(Commands.SbPlayerSet(this, value!!)) - } - if (!isTemp) { - Function.addCommand(Commands.SbPlayerOperation(re, "=", this)) - } else { - re = this - } - Function.addCommand(Commands.SbPlayerOperation(re, "%=", a as MCInt)) - } - return re - } - - @Override - override fun greaterCommand(a: Number): MCBool? { - //re = t > a - val re: MCBool? - if (isConcrete && a.isConcrete) { - re = MCBool(value!! > a.value!!) - } else if (isConcrete) { - re = a.lessCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq matches a+1.. - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " matches " + (a.value!! + 1) + ".." - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " > " + a.identifier + " " + a.`object` - ) - } - return re - } - - @Override - override fun lessCommand(a: Number): MCBool? { - //re = t < a - val re: MCBool? - if (isConcrete && a.isConcrete) { - re = MCBool(value!! < a.value!!) - } else if (isConcrete) { - re = a.greaterCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq matches a+1.. - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " matches " + ".." + (a.value!! - 1) - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " < " + a.identifier + " " + a.`object` - ) - } - return re - } - - @Override - override fun lessOrEqualCommand(a: Number): MCBool? { - //re = t <= a - val re: MCBool? - if (isConcrete && a.isConcrete) { - re = MCBool(value!! <= a.value!!) - } else if (isConcrete) { - re = a.greaterCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq matches a+1.. - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " matches " + ".." + a.value - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " <= " + a.identifier + " " + a.`object` - ) - } - return re - } - - @Override - override fun greaterOrEqualCommand(a: Number): MCBool? { - //re = t <= a - val re: MCBool? - if (isConcrete && a.isConcrete) { - re = MCBool(value!! >= a.value!!) - } else if (isConcrete) { - re = a.greaterCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq matches a+1.. - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " matches " + a.value + ".." - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " >= " + a.identifier + " " + a.`object` - ) - } - return re - } - - @Override - override fun equalCommand(a: Number): MCBool? { - //re = t == a - val re: MCBool? - if (isConcrete && a.isConcrete) { - re = MCBool(Objects.equals(value, a.value)) - } else if (isConcrete) { - re = a.equalCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq = owo owo - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " matches " + a.value - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " if score " + identifier + " " + `object` + " = " + a.identifier + " " + a.`object` - ) - } - return re - } - - @Override - override fun notEqualCommand(a: Number): MCBool? { - //re = t != a - val re: MCBool? - if (isConcrete && a.isConcrete) { - re = MCBool(!Objects.equals(value, a.value)) - } else if (isConcrete) { - re = a.equalCommand(this) - } else if (a.isConcrete) { - //execute store success score qwq qwq if score qwq qwq = owo owo - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " unless score " + identifier + " " + `object` + " matches " + a.value - ) - } else { - re = MCBool() - Function.addCommand( - "execute store success score " + re.identifier + " " + SbObject.MCS_boolean - + " unless score " + identifier + " " + `object` + " = " + a.identifier + " " + a.`object` - ) - } - return re - } - - @Override - override fun clone(): MCInt { - return MCInt(this) - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/MCString.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/MCString.kt deleted file mode 100644 index 3adfb148..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/MCString.kt +++ /dev/null @@ -1,43 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.exception.VariableConverseException - -class MCString : Var { - var value: String? = null - override var type = "string" - - constructor(value: String?) { - this.value = value - isTemp = true - } - - constructor(value: String?, identifier: String?) { - this.identifier = identifier!! - } - - constructor(b: MCString) { - value = b.value - type = b.type - } - - - @Override - override fun toString(): String { - return value!! - } - - @Override - @Throws(VariableConverseException::class) - override fun assign(b: Var?) { - } - - @Override - override fun cast(type: String): Var? { - return null - } - - @Override - override fun clone(): MCString { - TODO() - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/NativeClassObject.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/NativeClassObject.kt deleted file mode 100644 index 6ad5a5df..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/NativeClassObject.kt +++ /dev/null @@ -1,61 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.exception.VariableConverseException -import top.alumopper.mcfpp.lib.NativeClass -import java.util.* -import kotlin.collections.ArrayList - -class NativeClassObject : Var { - /** - * 它的类型 - */ - var clsType: NativeClass? = null - - /** - * 它的java类的实例 - */ - var javaClassObject: INativeClass - - /** - * 类的字符串标识符 - */ - @get:Override - override var type: String - - /** - * 初始化类实例的时候自动生成的临时指针 - */ - var initPointer: ClassPointer - - constructor(clsType: NativeClass, args: ArrayList) { - this.clsType = clsType - type = clsType.identifier - initPointer = ClassPointer(clsType, clsType, UUID.randomUUID().toString()) - //创建java实例 - //列表转数组 - val vars = arrayOfNulls(args.size) - javaClassObject = clsType.cls.getDeclaredConstructor(Array::class.java, ClassPointer::class.java) - .newInstance(vars, initPointer) - } - - constructor(b: NativeClassObject) { - cls = b.cls - javaClassObject = b.javaClassObject - type = b.type - initPointer = b.initPointer - } - @Override - @Throws(VariableConverseException::class) - override fun assign(b: Var?) { - } - - @Override - override fun cast(type: String): Var? { - return null - } - - @Override - override fun clone(): NativeClassObject { - TODO() - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/Number.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/Number.kt deleted file mode 100644 index 6d8511eb..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/Number.kt +++ /dev/null @@ -1,120 +0,0 @@ -package top.alumopper.mcfpp.lang - -/** - * 代表了mcfpp中的一个数字类型。数字类型都是以记分板为基础的。 - * 泛型T代表了这个数字类型中包装的类型 - */ -abstract class Number : Var, OnScoreboard { - var value: T? = null - var `object`: SbObject - - /** - * 创建一个匿名数字类型变量 - */ - constructor() : super() { - `object` = SbObject.MCS_default - } - - /** - * 创建一个数字类型变量 - * @param i 标识符 - */ - constructor(i: String) { - identifier = i - `object` = SbObject.MCS_default - } - - constructor(b: Number) : super(b) { - value = b.value - `object` = b.`object` - } - - @Override - override fun setObj(sbObject: SbObject): Number { - `object` = sbObject - return this - } - - /** - * 赋值 - * @param a 值来源 - */ - abstract fun assignCommand(a: Number) - - /** - * 加法 - * @param a 加数 - * @return 计算的结果 - */ - abstract fun addCommand(a: Number): Number - - /** - * 减法 - * @param a 减数 - * @return 计算的结果 - */ - abstract fun minusCommand(a: Number): Number - - /** - * 乘法 - * @param a 乘数 - * @return 计算的结果 - */ - abstract fun multipleCommand(a: Number): Number - - /** - * 除法 - * @param a 除数 - * @return 计算的结果 - */ - abstract fun divideCommand(a: Number): Number - - /** - * 取余 - * @param a 除数 - * @return 计算的结果 - */ - abstract fun modularCommand(a: Number): Number - - /** - * 这个数是否大于a - * @param a 右侧值 - * @return 计算结果 - */ - abstract fun greaterCommand(a: Number): MCBool? - - /** - * 这个数是否小于a - * @param a 右侧值 - * @return 计算结果 - */ - abstract fun lessCommand(a: Number): MCBool? - - /** - * 这个数是否小于等于a - * @param a 右侧值 - * @return 计算结果 - */ - abstract fun lessOrEqualCommand(a: Number): MCBool? - - /** - * 这个数是否大于等于a - * @param a 右侧值 - * @return 计算结果 - */ - abstract fun greaterOrEqualCommand(a: Number): MCBool? - - /** - * 这个数是否等于a - * @param a 右侧值 - * @return 计算结果 - */ - abstract fun equalCommand(a: Number): MCBool? - - /** - * 这个数是否不等于a - * @param a 右侧值 - * @return 计算结果 - */ - abstract fun notEqualCommand(a: Number): MCBool? -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/OnScoreboard.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/OnScoreboard.kt deleted file mode 100644 index 794bdcd4..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/OnScoreboard.kt +++ /dev/null @@ -1,8 +0,0 @@ -package top.alumopper.mcfpp.lang - -/** - * 描述了所有基于单个记分板表达的类。 - */ -interface OnScoreboard { - fun setObj(sbObject: SbObject): OnScoreboard -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/SbObject.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/SbObject.kt deleted file mode 100644 index 2a4ea460..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/SbObject.kt +++ /dev/null @@ -1,49 +0,0 @@ -package top.alumopper.mcfpp.lang - -import java.util.* - -/** - * 一个计分板对象。 - */ -//C# TO JAVA CONVERTER TODO TASK: Java annotations will not correspond to .NET attributes: -//ORIGINAL LINE: [Inline] public class SbObject -class SbObject(name: String, rule: String, var display: JsonText?) { - var name: String - var rule: String - - constructor(name: String, rule: String) : this(name, rule, null) - constructor(name: String) : this(name, "dummy", null) - - init { - this.name = name.lowercase(Locale.getDefault()) - this.rule = rule.lowercase(Locale.getDefault()) - } - - @Override - override fun toString(): String { - return name - } - - @Override - override fun equals(other: Any?): Boolean { - return other is SbObject && name == other.name - } - - override fun hashCode(): Int { - return name.hashCode() - } - - companion object { - /** - * mcfpp数学计算使用的计分板对象。 - */ - var MCS_intvar = SbObject("mcs_intvar", "dummy") - - /** - * mcfpp默认的计分板变量 - */ - var MCS_default = SbObject("mcs_default", "dummy") - var MCS_params = SbObject("mcs_params", "dummy") - var MCS_boolean = SbObject("mcs_boolean", "dummy") - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/SbValue.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/SbValue.kt deleted file mode 100644 index 3f5d9f94..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/SbValue.kt +++ /dev/null @@ -1,20 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.exception.VariableConverseException - -class SbValue : Var() { - @Override - @Throws(VariableConverseException::class) - override fun assign(b: Var?) { - } - - @Override - override fun cast(type: String): Var? { - return null - } - - @Override - override fun clone(): SbValue { - TODO() - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/Selector.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/Selector.kt deleted file mode 100644 index 3fa0d696..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/Selector.kt +++ /dev/null @@ -1,32 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.exception.VariableConverseException - -class Selector(identifier: String?) : Var() { - @get:Override - override var type = "selector" - var text: String? = null - - init { - this.identifier = identifier!! - } - - @Override - override fun assign(b: Var?) { - if (b is MCString) { - text = b.toString() - } else { - throw VariableConverseException() - } - } - - @Override - override fun cast(type: String): Var? { - return null - } - - @Override - override fun clone(): Selector { - TODO() - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lang/Var.kt b/src/main/kotlin/top/alumopper/mcfpp/lang/Var.kt deleted file mode 100644 index 16db0e27..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lang/Var.kt +++ /dev/null @@ -1,220 +0,0 @@ -package top.alumopper.mcfpp.lang - -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.exception.VariableConverseException -import top.alumopper.mcfpp.lib.CacheContainer -import top.alumopper.mcfpp.lib.Class -import top.alumopper.mcfpp.lib.ClassMember -import java.util.* - -/** - * mcfpp所有类型的基类。在mcfpp中,一个变量可以是固定的,也就是mcfpp编译 - * 能知道确切值的变量。例如`int i = 0;`中,编译器可以明确i的值就是 - * 0。另外,还可能有编译器并不知道确切值的变量。例如`int i = e.pos[0]`, - * 获取了一个实体的x坐标。编译器并不能知道这个实体的坐标会是什么。 - * - * - * 对于固定的值,编译器会尽可能计算出他们的值。例如`int i = 6 + 7 + p`, - * 编译器会提前计算为`int i = 13 + p`,从而减少命令的使用量。 - * - * - * - * 除此之外,变量还有临时变量的区别,对于匿名的变量,编译器一般会默认它为临时 - * 的变量,从而在各种处理上进行优化。当然,匿名变量的声明往往在编译过程中声明。 - * mcfpp本身的语法并不支持匿名变量。 - * - */ -abstract class Var : ClassMember, Cloneable { - /** - * 标识符 - */ - var identifier: String - - /** - * 在缓存中的名字 - */ - var key: String? = null - - /** - * 是否是已知的(固定的) - */ - var isConcrete = false - - /** - * 是否是临时变量 - */ - var isTemp = false - - /** - * 变量在栈里面的位置 - */ - var stackIndex: Int = 0 - - /** - * - */ - @get:Override - @set:Override - override var isStatic = false - - /** - * 这个变量是否是常量 - */ - var isConst = ConstStatus.NOT_CONST - - enum class ConstStatus { - NOT_CONST, NULL, ASSIGNED - } - - /** - * 访问修饰符 - */ - override var accessModifier: ClassMember.AccessModifier = ClassMember.AccessModifier.PRIVATE - - /** - * 成员所在的类 - */ - open var cls: CanSelectMember? = null - - init { - identifier = UUID.randomUUID().toString() - } - - constructor(`var` : Var) { - identifier = `var`.identifier - key = `var`.key - isStatic = `var`.isStatic - accessModifier = `var`.accessModifier - isConcrete = `var`.isConcrete - isTemp = `var`.isTemp - stackIndex = `var`.stackIndex - isConst = `var`.isConst - cls = `var`.cls - } - - constructor() - - open val type: String - /** - * 获取变量的类型 - * @return 变量类型的字符串 - */ - get() = "var" - - /** - * 将b中的值赋值给此变量 - * @param b 变量的对象 - */ - @Throws(VariableConverseException::class) - abstract fun assign(b: Var?) - - /** - * 将这个变量强制转换为一个类型 - * @param type 要转换到的目标类型 - */ - abstract fun cast(type: String): Var? - - @Override - override fun Class(): Class? { - return null - } - - @Override - public abstract override fun clone(): Any - - companion object { - /** - * 解析变量上下文,构造上下文声明的变量 - * @param ctx 变量声明的上下文 - * @param container 变量所在缓存 - * @return 声明的变量 - */ - fun build(ctx: mcfppParser.FieldDeclarationContext, container: CacheContainer): Var? { - var `var`: Var? = null - if (ctx.type().className() == null) { - //普通类型 - when (ctx.type().text) { - "int" -> `var` = MCInt(ctx.Identifier().text, container) - "bool" -> `var` = MCBool(ctx.Identifier().text, container) - } - } else if (ctx.type().className().InsideClass() != null) { - when (ctx.type().className().InsideClass().text) { - "selector" -> `var` = Selector(ctx.Identifier().text) - "entity" -> `var` = null - "string" -> `var` = null - } - } else { - //自定义的类的类型 - val cls: String = ctx.type().className().text - //取出类 - val type: Class? = Project.global.cache.classes.getOrDefault(cls, null) - if (type == null) { - Project.logger.error( - "Undefined class:" + cls + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - assert(type != null) - `var` = ClassPointer(type!!, container, ctx.Identifier().text) - } - return `var` - } - - /** - * 解析变量声明上下文,构造上下文声明的变量,作为类的成员 - * @param ctx 变量声明上下文 - * @param cls 成员所在的类 - * @return 这个变量 - */ - fun build(ctx: mcfppParser.FieldDeclarationContext, cls: Class): Var? { - var `var`: Var? = null - if (ctx.type().className() == null) { - //普通类型 - when (ctx.type().text) { - "int" -> { - `var` = - MCInt("@s").setObj(SbObject(cls.namespace + "_class_" + cls.identifier + "_int_" + ctx.Identifier())) - `var`.key = ctx.Identifier().text - } - - "bool" -> { - `var` = - MCBool("@s").setObj(SbObject(cls.namespace + "_class_" + cls.identifier + "_bool_" + ctx.Identifier())) - `var`.key = ctx.Identifier().text - } - } - } else if (ctx.type().className().InsideClass() != null) { - when (ctx.type().className().InsideClass().text) { - "selector" -> `var` = Selector(ctx.Identifier().text) - "entity" -> `var` = null - "string" -> `var` = null - } - } else { - //自定义的类的类型 - val clsType: String = ctx.type().className().text - //取出类 - val type: Class? = Project.global.cache.classes.getOrDefault(clsType, null) - if (type == null) { - Project.logger.error( - "Undefined class:" + clsType + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - assert(type != null) - val classPointer = ClassPointer(type!!, cls, ctx.Identifier().text) - classPointer.address = - (MCInt("@s").setObj(SbObject(cls.namespace + "_class_" + cls.identifier + "_" + clsType + "_" + ctx.Identifier())) as MCInt) - classPointer.identifier = ctx.Identifier().text - `var` = classPointer - } - //是否是常量 - if (ctx.CONST() != null) { - `var`!!.isConst = ConstStatus.NULL - `var`.isConcrete = true - } - return `var` - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/Cache.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/Cache.kt deleted file mode 100644 index aa84fc5d..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/Cache.kt +++ /dev/null @@ -1,217 +0,0 @@ -package top.alumopper.mcfpp.lib - -import org.jetbrains.annotations.Nullable -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.lang.* -import java.util.* - -/** - * 一个缓存。在编译过程中,编译器读取到的变量,函数等会以键值对的方式储存在其中。键为函数的id或者变量的 - * 标识符,而值则是这个函数或者变量的对象。 - * 缓存应该是一个链式的结构,主要分为如下几种情况:

- * 类的静态变量 ---> 类的成员变量 --> 函数 ---> 匿名内部函数

- * 类的静态变量 ---> 静态函数 ---> 匿名内部函数

- * 函数 ---> 匿名内部函数

- * 寻找变量的时候,应当从当前的作用域开始寻找。

- * - * - * 变量和类都分别储存在一张哈希表中,键名即它在声明的时候的名字,而值则代表了它的对象。 - * 值得注意的是,变量声明时的名字虽然和最终编译出的名字有关,但不相同。 - * - * - * - * 函数储存在一个列表中 - * - */ -class Cache { - /** - * 变量缓存 - */ - private val vars: HashMap = HashMap() - - /** - * 函数缓存 - */ - var functions: ArrayList = ArrayList() - - /** - * 类缓存 - */ - var classes: HashMap = HashMap() - - /** - * 父级缓存。函数的父级缓存可能是类,也可能是全局。类的父级缓存总是全局,而全局则没有父级缓存 - */ - @Nullable - var parent: Cache? - - /** - * 这个缓存在哪一个容器中 - */ - @Nullable - var container: CacheContainer? = null - - /** - * 创建一个缓存,并指定它的父级 - * @param parent 父级缓存。若没有则设置为null - * @param cacheContainer 此缓存所在的容器 - */ - constructor(parent: Cache?, cacheContainer: CacheContainer?) { - this.parent = parent - container = cacheContainer - } - - /** - * 复制一个缓存。 - * @param cache 原来的缓存 - */ - constructor(cache: Cache) { - parent = cache.parent - //变量复制 - for (key in cache.vars.keys) { - val `var`: Var? = cache.vars[key] - vars[key] = `var`!!.clone() as Var - } - functions.addAll(cache.functions) - } - - /** - * 根据所给的函数名和参数获取一个函数 - * @param key 函数名 - * @param argsTypes 参数类型 - * @param namespace 命名空间 - * @return 如果此缓存中存在这个函数,则返回这个函数的对象,否则返回null - */ - @Nullable - fun getFunction(namespace: String, key: String, argsTypes: List): Function? { - for (f in functions) { - if (f.namespace == namespace && f.name == key && f.params.size == argsTypes.size) { - if (f.params.size == 0) { - return f - } - var hasFoundFunc = true - //参数比对 - for (i in argsTypes.indices) { - if (argsTypes[i] != f.params[i].type) { - hasFoundFunc = false - break - } - } - if (hasFoundFunc) { - return f - } - } - } - return null - } - //region Var - /** - * 向此缓存中添加一个新的变量键值对。如果已存在此对象,将不会进行覆盖。 - * @param key 变量的标识符 - * @param var 变量的对象 - * @return 如果缓存中已经存在此对象,则返回false,否则返回true。 - */ - fun putVar(key: String, `var`: Var): Boolean { - return if (vars.containsKey(key)) { - false - } else { - vars[key] = `var` - true - } - } - - /** - * 从缓存中取出一个变量。如果此缓存中没有,则从父缓存中寻找。 - * @param key 变量的标识符 - * @return 变量的对象。若不存在,则返回null。 - */ - fun getVar(key: String): Var? { - return vars.getOrDefault(key, null) - } - - val allVars: Collection - /** - * 获取此缓存中的全部变量。不会从父缓存搜索。 - * @return 一个包含了此缓存全部变量的集合。 - */ - get() = vars.values - - /** - * 缓存中是否包含某个变量 - * @param id 变量名 - * @return 如果包含则返回true,否则返回false - */ - fun containVar(id: String?): Boolean { - return vars.containsKey(id) - } - - companion object { - //endregion - /** - * TODO:DEBUG - * 打印所有的函数和类 - */ - fun printAll() { - for (s in Project.global.cache.functions) { - if (s is NativeFunction) { - println("native " + s.namespace + " -> " + s.javaReferContext!!.text) - } else { - println(s.namespaceID) - for (c in s.commands) { - println("\t" + c) - } - } - } - for (s in Project.global.cache.classes.values) { - if (s is NativeClass) { - println("native class " + s.namespace + ":" + s.identifier + " -> " + s.cls.toString()) - continue - } - println("class " + s.identifier) - println("\tconstructors:") - for (c in s.constructors) { - if (c is NativeConstructor) { - println("\t\tnative " + c.namespaceID) - } else { - println("\t\t" + c.namespaceID) - for (d in c.commands) { - println("\t\t\t" + d) - } - } - } - println("\tfunctions:") - for (f in s.cache!!.functions) { - if (f is NativeFunction) { - println( - "\t\t" + f.accessModifier.name - .lowercase(Locale.getDefault()) + " native " + (if (f.isStatic) "static" else "") + f.namespaceID - ) - } else { - println( - "\t\t" + f.accessModifier.name - .lowercase(Locale.getDefault()) + " " + (if (f.isStatic) "static" else "") + f.namespaceID - ) - for (d in f.commands) { - println("\t\t\t" + d) - } - } - } - println("\tattributes:") - for (v in s.cache!!.vars.values) { - println( - "\t\t" + v.accessModifier.name - .lowercase(Locale.getDefault()) + " " + (if (v.isStatic) "static " else "") + v.type + " " + v.key - ) - } - } - } //public static Object getKey(Map map, Object value){ - // List keyList = new ArrayList<>(); - // for(Object key: map.keySet()){ - // if(map.get(key).equals(value)){ - // keyList.add(key); - // } - // } - // return keyList.get(0); - //} - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/Class.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/Class.kt deleted file mode 100644 index 5bd94ec2..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/Class.kt +++ /dev/null @@ -1,210 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.exception.FunctionDuplicationException -import top.alumopper.mcfpp.lang.ClassObject -import top.alumopper.mcfpp.lang.MCInt -import top.alumopper.mcfpp.lang.Var -import top.alumopper.mcfpp.lang.SbObject -import java.util.ArrayList - -/** - * 一个类。 - * 类的理论部分参见: - * [在mcfunction中实现面向对象](https://alumopper.top/%e5%9c%a8mcfunction%e4%b8%ad%e5%ae%9e%e7%8e%b0%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1/) - * 和[mcfpp面向对象——类的创建和销毁](https://alumopper.top/mcfpp%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1-%e7%b1%bb%e7%9a%84%e5%88%9b%e5%bb%ba%e5%92%8c%e9%94%80%e6%af%81/) - * - * 类编译后的名字和声明时的名字是一致的。除了某些编译器硬编码的特殊的类以外,mcfpp中的类总是以大写字母开头。 - */ -open class Class : CacheContainer { - /** - * 这个类的标识符 - */ - lateinit var identifier: String - - /** - * 类的命名空间 - */ - lateinit var namespace: String - - /** - * 这个类的父类 - */ - var parent: Class? = null - - /** - * 成员变量和成员函数 - */ - var cache: Cache? = null - - /** - * 静态变量和静态函数 - */ - var staticCache: Cache? = null - - /** - * 记录这个类所有实例地址的记分板 - */ - lateinit var addressSbObject: SbObject - - /** - * 成员变量对应的初始化计算表达式 - */ - var varInitExpression: HashMap? = null - - /** - * 静态变量对应的初始化计算表达式 - */ - var staticVarInitExpression: HashMap? = null - - /** - * 构造函数 - */ - var constructors: ArrayList = ArrayList() - - /** - * 是否是静态类。静态类将不会被垃圾处理器处理 - */ - var isStaticClass = false - - /** - * 类的字段初始化函数 - */ - lateinit var classPreInit: Function - - /** - * 类的静态字段的初始化函数 - */ - lateinit var classPreStaticInit: Function - - /** - * 生成一个类。它拥有指定的标识符和默认的命名空间 - * @param identifier 类的标识符 - */ - constructor(identifier: String) : this(identifier, Project.currNamespace) - - /** - * 生成一个类,它拥有指定的标识符和命名空间 - * @param identifier 类的标识符 - * @param namespace 类的命名空间 - */ - constructor(identifier: String, namespace: String) { - this.identifier = identifier - this.namespace = namespace - classPreInit = Function("_class_preinit_$identifier", this, false) - classPreStaticInit = Function("_class_preinit_$identifier", this, true) - staticCache = Cache(Project.global.cache, this) - cache = Cache(staticCache!!, this) - cache!!.functions.add(classPreInit) - staticCache!!.functions.add(classPreStaticInit) - addressSbObject = SbObject(namespace + "_class_" + identifier + "_index") - //init函数的初始化置入,即地址分配,原preinit函数合并于此。同时生成新的临时指针 - classPreInit.commands.add("scoreboard players operation @s " + addressSbObject.name + " = \$index " + addressSbObject.name) - classPreInit.commands.add("scoreboard players add \$index " + addressSbObject.name + " 1") - } - - constructor() - - @get:Override - override val prefix: String - get() = Project.name.toString() + "_class_" + identifier + "_" - - /** - * 根据参数列表获取一个类的构造函数 - * @param params 构造函数的参数列表 - * @return 返回这个类的参数 - */ - fun getConstructor(params: ArrayList): Constructor? { - for (f in constructors) { - if (f.params.size == params.size) { - if (f.params.size == 0) { - return f - } - //参数比对 - for (i in 0 until params.size) { - if (params[i] == f.params[i].type) { - return f - } - } - } - } - return null - } - - /** - * 返回此类中的一个成员字段。优先获取成员变量中的字段 - * @param key 字段名 - * @return 如果字段存在,则返回此字段,否则返回null - */ - fun getMemberVar(key: String?): Var? { - return cache!!.getVar(key!!) ?: return staticCache!!.getVar(key) - } - - /** - * 向这个类中添加一个成员 - * @param classMember 要添加的成员 - */ - fun addMember(classMember: ClassMember) { - //非静态成员 - if (!classMember.isStatic) { - if (classMember is Function) { - currClass!!.cache!!.functions.add(classMember) - } else if (classMember is Var) { - currClass!!.cache!!.putVar(classMember.key!!, classMember) - } - return - } - //静态成员 - if (classMember is Function) { - currClass!!.staticCache!!.functions.add(classMember) - } else if (classMember is Var) { - currClass!!.staticCache!!.putVar(classMember.key!!, classMember) - } - } - - /** - * 向这个类中添加一个构造函数 - * @param constructor 构造函数 - */ - fun addConstructor(constructor: Constructor) { - if (constructors.contains(constructor)) { - throw FunctionDuplicationException() - } else { - constructors.add(constructor) - } - } - - /** - * 创建这个类的一个实例 - * @return 创建的实例 - */ - fun newInstance(): ClassObject { - //创建实例 - val obj = ClassObject(this, this, "temp") - //给这个类添加成员 - obj.cache = Cache(cache!!) - obj.address = MCInt("@s").setObj(addressSbObject) as MCInt - return obj - } - - /** - * 这个类是否可以被强制转换为目标类型 - * @param target 目标类型 - * @return 如果可以,返回true,反之返回false - */ - fun canCastTo(target: Class): Boolean { - if (identifier.equals(target.identifier)) { - return true - } - return if (parent != null) { - parent!!.canCastTo(target) - } else false - } - - companion object { - /** - * 当前编译器正在编译的类 - */ - var currClass: Class? = null - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/ClassMember.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/ClassMember.kt deleted file mode 100644 index 7c5c19b4..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/ClassMember.kt +++ /dev/null @@ -1,15 +0,0 @@ -package top.alumopper.mcfpp.lib - -/** - * 一个类的成员 - */ -interface ClassMember { - enum class AccessModifier { - PRIVATE, PROTECTED, PUBLIC - } - - var accessModifier : AccessModifier - - var isStatic: Boolean - fun Class(): Class? -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/Constructor.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/Constructor.kt deleted file mode 100644 index 89782ae6..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/Constructor.kt +++ /dev/null @@ -1,99 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.command.Commands -import top.alumopper.mcfpp.lang.* -import java.util.* -import kotlin.collections.ArrayList - -/** - * 一个构造函数 - */ -open class Constructor //检查此类中是否已经重复定义一个相同的构造函数 - ( - /** - * 此构造函数对应的类。 - */ - var target: Class -) : Function("_init_" + target.identifier.lowercase(Locale.getDefault()) + "_" + target.constructors.size, target, false) { - /** - * 调用构造函数 - * @param args 函数的参数 - * @param lineNo 调用此函数的上下文的行数,用于错误日志 - * @param cls 调用函数的实例 - */ - @Override - override operator fun invoke(args: ArrayList, lineNo: Int, cls: ClassPointer) { - //对象创建 - Function.addCommand( - "execute in minecraft:overworld " + - "run summon marker 0 0 0 {Tags:[" + cls.obj!!.tag + ",mcfpp_classPointer_just],data:{pointers:[]}}" - ) - //给函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - //参数传递 - for (i in 0 until params.size) { - when (params[i].type) { - "int" -> { - val tg = args[i].cast(params[i].type) as MCInt - //参数传递和子函数的参数压栈 - Function.addCommand( - "execute store result storage mcfpp:system " + Project.name + ".stack_frame[0]." + params[i].identifier + " run " - + Commands.SbPlayerOperation(MCInt("_param_" + params[i].identifier, this), "=", tg) - ) - } - } - } - //函数调用的命令 - //不应当立即调用它自己的函数,应当先调用init,再调用constructor - Function.addCommand( - "execute as @e[tag=" + cls.obj!!.tag + ",tag=mcfpp_classPointer_just,limit=1] at @s run " + - Commands.Function(parentClass!!.classPreInit!!) - ) - Function.addCommand( - "execute as @e[tag=" + cls.obj!!.tag + ",tag=mcfpp_classPointer_just,limit=1] at @s run " + - Commands.Function(this) - ) - //调用完毕,将子函数的栈销毁 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - //取出栈内的值到记分板 - for (`var` in Function.currFunction!!.cache.allVars) { - if (`var` is MCInt) { - //如果是int取出到记分板 - Function.addCommand( - "execute store result score " + `var`.identifier + " " + `var`.`object` + " run " - + "data get storage mcfpp:system " + Project.name + ".stack_frame[0]." + `var`.key - ) - } - } - //临时指针的创建 - Function.addCommand("scoreboard players operation " + cls.address.identifier + " " + cls.address.`object`.name + " = @e[tag=" + cls.obj!!.tag + ",tag=mcfpp_classPointer_just,limit=1] " + cls.address.`object`.name) - //去除临时标签 - Function.addCommand("tag remove @e[tag=" + cls.obj!!.tag + ",tag=mcfpp_classPointer_just,limit=1] mcfpp_classPointer_just") - } - - @get:Override - override val prefix: String - get() = namespace + "_class_" + target.identifier + "_init_" - - @Override - override fun equals(other: Any?): Boolean { - if (other is Constructor) { - if (other.parentClass?.equals(parentClass) == true) { - if (other.params.size == params.size) { - for (i in 0 until other.params.size) { - if (other.params[i] != params[i]) { - return false - } - } - return true - } - } - } - return false - } - - override fun hashCode(): Int { - return target.hashCode() ?: 0 - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/Function.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/Function.kt deleted file mode 100644 index 5134be29..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/Function.kt +++ /dev/null @@ -1,417 +0,0 @@ -package top.alumopper.mcfpp.lib - -import org.jetbrains.annotations.Nullable -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.command.Commands -import top.alumopper.mcfpp.lang.* -import java.lang.NullPointerException -import java.util.ArrayList - -/** - * 一个minecraft中的命令函数。 - * - * - * 在mcfpp中,一个命令函数可能是单独存在的,也有可能是一个类的成员。 - * - * - * - * 在一般的数据包中,命令函数的调用通常只会是一个简单的`function xxx:xxx` - * 这样的形式。这条命令本身的意义便确实是调用一个函数。然而我们需要注意的是,在mc中, - * 一个命令函数并没有通常意义上的栈,换句话说,所有的变量都是全局变量,这显然是不符合 - * 一般的高级语言的规范的。在mcfpp中,我们通过`storage`的方法来模拟一个函数 - * 的栈。 - * - * - * - * mcfpp栈的模拟参考了[https://www.mcbbs.net/thread-1393132-1-1.html](https://www.mcbbs.net/thread-1393132-1-1.html) - * 的方法。在下面的描述中,也是摘抄于此文。 - * - * - * - * c语言底层是如何实现“局部变量”的?我们以 c 语言为例,看看函数底层的堆栈实现过程是什么样的?请看下面这段代码: - * {@snippet : - * * int test() { - * * int a = 1;// 位置1 - * * funA(a); - * * // 位置5 - * * } - * * int funA(int a) {// 位置2 - * * a = a + 1; - * * funB(a); - * * // 位置4 - * * } - * * int funB(int a) {// 位置3 - * * a = a + 1; - * * } - * * } - * 位置①:现在父函数还没调用 funA,堆栈情况是:

- * low address [ [父函数栈帧] ... ] high address

- * (执行 funA(?) )

- * 位置②:当父函数调用 funA 时,会从栈顶开一块新的空间来保存 funA 的栈帧,堆栈情况是:

- * low address [ [funA栈帧] [父函数栈帧] ... ] high address

- * (执行 a = a + 1)

- * (执行 funB(a) )

- * 位置③:当 funA 调用 funB 时,会从栈顶开一块新的空间来保存 funB 的栈帧,堆栈情况是:

- * low address [ [funB栈帧] [funA栈帧] [父函数栈帧] ... ] high address

- * (执行 a = a + 2)

- * 位置④:funB 调用结束,funB 的栈帧被销毁,程序回到 funA 继续执行,堆栈情况是:

- * low address [ [funA栈帧] [父函数栈帧] ... ] high address

- * 位置⑤:funA 调用结束,funA 的栈帧被销毁,程序回到 父函数 继续执行,堆栈情况是:

- * low address [ [父函数栈帧] ... ] high address

- * 我们会发现,funA 和 funB 使用的变量都叫 a,但它们的位置是不同的,此处当前函数只会在属于自己的栈帧的内存空间上 - * 操作,不同函数之间的变量之所以不会互相干扰,也是因为它们在栈中使用的位置不同,此 a 非彼 a - * - * - * - * mcf 如何模拟这样的堆栈?

- * 方法:将 storage 视为栈,将记分板视为寄存器

- * 与汇编语言不同的是,一旦我们这么想,我们就拥有无限的寄存器,且每个寄存器都可以是专用的,所以在下面的叙述中, - * 如果说“变量”,指的是寄存器,也就是记分板里的值;只有说“变量内存空间”,才是指 storage 中的值;变量内存空间类似函数栈帧

- * 我们可以使用 storage 的一个列表,它专门用来存放函数的变量内存空间

- * 列表的大致模样: stack_frame [{funB变量内存空间}, {funA变量内存空间}, {父函数变量内存空间}]

- * 每次我们要调用一个函数,只需要在 stack_frame 列表中前插一个 {},然后压入参数

- * - * - * - * 思路有了,接下来就是命令了。虽然前面的思路看起来非常复杂,但是实际上转化为命令的时候就非常简单了。 - *
- * `#父函数为子函数创建变量内存空间
- * data modify storage mny:program stack_frame prepend value {}
- * #父函数处理子函数的参数,压栈
- * execute store result storage mny:program stack_frame[0].xxx run ...
- * #给子函数打电话(划去)调用子函数
- * function xxx:xxx
- * #父函数销毁子函数变量内存空间
- * data remove storage mny:program stack_frame[0]
- * #父函数恢复记分板值
- * xxx(命令略去)
-` *
-
* - * - * - * - * 你可以在[McfppImListener]中的`exitFunctionCall`方法中看到mcfpp是如何实现的。 - * - * @see InternalFunction - */ -open class Function : ClassMember, CacheContainer { - /** - * 包含所有命令的列表 - */ - var commands: ArrayList - - /** - * 函数的名字 - */ - var name: String - - /** - * 函数的标签 - * TODO 函数的标签应该是一个列表 - */ - var tag: FunctionTag? = null - - /** - * 函数的命名空间。默认为工程文件的明明空间 - */ - var namespace: String - - /** - * 参数列表 - */ - var params: ArrayList - - /** - * 是否是类的成员函数。默认为否 - */ - var isClassMember = false - - /** - * 函数编译时的缓存 - */ - var cache: Cache - - /** - * 这个函数调用的函数 - */ - var child: ArrayList = ArrayList() - - /** - * 调用这个函数的函数 - */ - var parent: ArrayList = ArrayList() - - /** - * 函数是否已经实际中止。用于break和continue语句。 - */ - var isEnd = false - - /** - * 访问修饰符。默认为private - */ - override var accessModifier: ClassMember.AccessModifier = ClassMember.AccessModifier.PRIVATE - - /** - * 是否是静态的。默认为否 - */ - @get:Override - @set:Override - override var isStatic = false - - /** - * 所在的类。如果不是类成员,则为null - */ - @Nullable - var parentClass: Class? = null - - /** - * 创建一个函数 - * @param name 函数的标识符 - */ - constructor(name: String) { - this.name = name - commands = ArrayList() - params = ArrayList() - namespace = Project.currNamespace - cache = Cache(null, this) - } - - /** - * 创建一个函数,并指定它所属的类。 - * @param name 函数的标识符 - */ - constructor(name: String, cls: Class, isStatic: Boolean) { - this.name = name - commands = ArrayList() - params = ArrayList() - namespace = cls.namespace - parentClass = cls - isClassMember = true - if (isStatic) { - cache = Cache(cls.cache, this) - } else { - cache = Cache(cls.staticCache, this) - } - } - - /** - * 创建一个函数,它有指定的标签 - * @param name 函数的标识符 - * @param namespace 函数的命名空间 - */ - constructor(name: String, namespace: String) : this(name) { - this.namespace = namespace - } - - /** - * 获取这个函数的id,它包含了这个函数的路径和函数的标识符。每一个函数的id都是唯一的 - * @return 函数id - */ - fun GetID(): String { - return name - } - - val namespaceID: String - /** - * 获取这个函数的命名空间id,即xxx:xxx形式。可以用于命令 - * @return 函数的命名空间id - */ - get() { - val re: StringBuilder = StringBuilder("$namespace:$name") - for (p in params) { - re.append("_").append(p.type) - } - return re.toString() - } - - /** - * 从这个函数的变量声明缓存中获取一个变量。 - * @param id 这个变量的标识符 - * @return 如果这个变量存在缓存中,则返回这个变量,否则返回null - */ - open fun getVar(id: String): Var? { - val re: Var? = cache.getVar(id) - if (re != null) { - re.stackIndex = 0 - } - return re - } - - fun addParams(ctx: mcfppParser.ParameterListContext) { - //函数参数解析 - for (param in ctx.parameter()) { - val param1 = FunctionParam( - param.type().text, - param.Identifier().text, - param.STATIC() != null - ) - params.add(param1) - if (param1.type == "int") { - cache.putVar(param1.identifier, MCInt(namespaceID + "_param_" + param1.identifier, this)) - } - if (param1.type == "bool") { - cache.putVar(param1.identifier, MCBool(namespaceID + "_param_" + param1.identifier, this)) - } - } - } - - val paramTypeList: ArrayList - get() { - val re: ArrayList = ArrayList() - for (p in params) { - re.add(p.type) - } - return re - } - - /** - * 调用这个函数 - * @param args 函数的参数 - */ - open operator fun invoke(args: ArrayList, lineNo: Int) { - //给函数开栈 - addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - //参数传递 - for (i in 0 until params.size) { - when (params[i].type) { - "int" -> { - val tg = args[i].cast(params[i].type) as MCInt - //参数传递和子函数的参数压栈 - addCommand( - "execute store result storage mcfpp:system " + Project.name + ".stack_frame[0]." + params[i].identifier + " run " - + Commands.SbPlayerOperation(MCInt("_param_" + params[i].identifier, this), "=", tg) - ) - } - } - } - //函数调用的命令 - addCommand(Commands.Function(this)) - //static关键字,将值传回 - for (i in 0 until params.size) { - if (params[i].isStatic) { - //如果是static参数 - if (args[i] is MCInt) { - if (params[i].type == "int") { - //如果是int取出到记分板 - addCommand( - "execute store result score " + (args[i] as MCInt).identifier + " " + (args[i] as MCInt).`object` + " run " - + "data get storage mcfpp:system " + Project.name + ".stack_frame[0]." + params[i].identifier - ) - } - } - } - } - //调用完毕,将子函数的栈销毁 - addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - //取出栈内的值到记分板 - for (`var` in currFunction.cache.allVars) { - if (`var` is MCInt) { - //如果是int取出到记分板 - addCommand( - "execute store result score " + `var`.identifier + " " + `var`.`object` + " run " - + "data get storage mcfpp:system " + Project.name + ".stack_frame[0]." + `var`.key - ) - } - } - } - - /** - * 调用这个函数。此函数是一个类的成员 - * @param args 函数的参数 - * @param lineNo 调用此函数的上下文的行数,用于错误日志 - * @param cls 调用函数的实例 - */ - open operator fun invoke(args: ArrayList, lineNo: Int, cls: ClassPointer) { - TODO() - } - - val cmdStr: String - get() { - val qwq: StringBuilder = StringBuilder() - for (s in commands) { - qwq.append(s).append("\n") - } - return qwq.toString() - } - - @get:Override - override val prefix: String - get() = Project.currNamespace + "_func_" + name + "_" - - /** - * 判断两个函数是否相同.判据包括:命名空间ID,是否是类成员,父类,标签和参数列表 - * @param other 要比较的对象 - * @return 若相同,则返回true - */ - @Override - override fun equals(other: Any?): Boolean { - if (other is Function) { - if (!((other.tag != null && other.tag!! == tag || other.tag == null && tag == null) && other.isClassMember == isClassMember && other.namespaceID == namespaceID && other.parentClass === parentClass) - ) { - return false - } - if (other.params.size == params.size) { - for (i in 0 until other.params.size) { - if (other.params[i].type != params[i].type) { - return false - } - } - return true - } - } - return false - } - - @Override - override fun Class(): Class? { - return if (isClassMember) { - parentClass - } else null - } - - override fun hashCode(): Int { - return namespace.hashCode() - } - - companion object { - /** - * 是不是break。用于break和continue语句。 - */ - var isBreak = false - - /** - * 当一个函数被break或continue截断的时候,使用此标记,表示此函数执行完毕后的函数应当重新建立一个匿名内部函数, - * 从而实现break和continue的逻辑控制。 - * 即同时满足isEnd == false和isLastFunctionEnd = 2的时候进入新的匿名break/continue内部函数 - * 0 未截断 - * 1 被截断,需要进入匿名函数 - * 2 被截断,但是已经在匿名函数里面了 - */ - var isLastFunctionEnd = 0 - - - /** - * 一个空的函数,通常用于作为占位符 - */ - var nullFunction = Function("null") - - /** - * 目前编译器处在的函数。允许编译器在全局获取并访问当前正在编译的函数对象。默认为全局初始化函数 - */ - var currFunction: Function = nullFunction - - /** - * 向此函数的末尾添加一条命令。 - * @param str 要添加的命令。 - */ - fun addCommand(str: String?) { - if(this.equals(nullFunction)){ - Project.logger.warn("Unexpected command added to NullFunction") - throw NullPointerException() - } - if (!currFunction.isEnd) { - currFunction.commands.add(str!!) - } - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/FunctionParam.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/FunctionParam.kt deleted file mode 100644 index 4bef9abd..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/FunctionParam.kt +++ /dev/null @@ -1,50 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.lang.Var -import java.util.ArrayList - -/** - * 函数的参数。用于函数声明的时候。 - */ -class FunctionParam( - /** - * 参数类型 - */ - var type: String, - /** - * 参数的名字 - */ - var identifier: String, - /** - * 参数是否为静态的 - */ - var isStatic: Boolean -) { - companion object { - /** - * 将一个参数列表转换为对应的字符串列表 - * @param params 参数列表 - * @return 它的字符串列表 - */ - fun toStringList(params: ArrayList): ArrayList { - val qwq: ArrayList = ArrayList() - for (param in params) { - qwq.add(param.type) - } - return qwq - } - - /** - * 将一个变量列表转换为对应的字符串列表 - * @param params 参数列表 - * @return 它的字符串列表 - */ - fun getVarTypes(params: ArrayList): ArrayList { - val qwq: ArrayList = ArrayList() - for (param in params) { - qwq.add(param.type) - } - return qwq - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/Global.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/Global.kt deleted file mode 100644 index 3d6575ee..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/Global.kt +++ /dev/null @@ -1,28 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.Project - -/** - * 全局 - */ -class Global : CacheContainer { - - /** - * 全局函数 - */ - lateinit var cache: Cache - - /** - * - */ - var functionTags: HashMap = HashMap() - - fun init(): Global { - cache = Cache(null, this) - return this - } - - @get:Override - override val prefix: String - get() = Project.name + "_global_" -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/InlineFunction.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/InlineFunction.kt deleted file mode 100644 index 1670dbe2..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/InlineFunction.kt +++ /dev/null @@ -1,23 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.lang.Var - -/** - * 内联函数 - */ -class InlineFunction : Function { - var context: mcfppParser.FunctionDeclarationContext - - constructor(name: String, context: mcfppParser.FunctionDeclarationContext) : super(name) { - this.context = context - } - - constructor(name: String, namespace: String, context: mcfppParser.FunctionDeclarationContext) : super(name, namespace) { - this.context = context - } - - @Override - override operator fun invoke(args: ArrayList, lineNo: Int) { - TODO() - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppExprVisitor.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/McfppExprVisitor.kt deleted file mode 100644 index bc1ed9dd..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppExprVisitor.kt +++ /dev/null @@ -1,415 +0,0 @@ -package top.alumopper.mcfpp.lib - -import mcfppBaseVisitor -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.exception.* -import top.alumopper.mcfpp.lang.* -import java.lang.reflect.InvocationTargetException -import java.util.* -import kotlin.collections.ArrayList - -/** - * 获取表达式结果用的visitor。解析并计算一个形如a+b*c的表达式。 - */ -class McfppExprVisitor : mcfppBaseVisitor() { - /** - * 计算一个复杂表达式 - * @param ctx the parse tree - * @return 表达式的结果 - */ - @Override - override fun visitExpression(ctx: mcfppParser.ExpressionContext): Var? { - return visit(ctx.conditionalOrExpression()) - } - //TODO 三目表达式。可能会实现,但是泠雪是懒狐,不想做。 - //@Override - //public Var visitConditionalExpression(mcfppParser.ConditionalExpressionContext ctx){ - // if(ctx.expression().size() == 0){ - // return visit(ctx.conditionalOrExpression()); - // }else { - // return null; - // } - //} - /** - * 计算一个或表达式。例如 a || b。 - * @param ctx the parse tree - * @return 表达式的值 - */ - @Override - override fun visitConditionalOrExpression(ctx: mcfppParser.ConditionalOrExpressionContext): Var? { - var re: Var? = visit(ctx.conditionalAndExpression(0)) - for (i in 1 until ctx.conditionalAndExpression().size) { - val b: Var? = visit(ctx.conditionalAndExpression(i)) - re = if (re is MCBool && b is MCBool) { - re.orCommand(b) - } else { - throw ArgumentNotMatchException("运算符'||'只能用于bool类型") - } - } - return re - } - - /** - * 计算一个与表达式。例如a && b - * @param ctx the parse tree - * @return 表达式的值 - */ - //和 - @Override - override fun visitConditionalAndExpression(ctx: mcfppParser.ConditionalAndExpressionContext): Var? { - var re: Var? = visit(ctx.equalityExpression(0)) - for (i in 1 until ctx.equalityExpression().size) { - val b: Var? = visit(ctx.equalityExpression(i)) - re = if (re is MCBool && b is MCBool) { - re.andCommand(b) - } else { - throw ArgumentNotMatchException("运算符'&&'只能用于bool类型") - } - } - return re - } - - /** - * 计算一个等于或不等于表达式,例如a == b和a != b - * @param ctx the parse tree - * @return 表达式的值 - */ - //等于或不等于 - @Override - override fun visitEqualityExpression(ctx: mcfppParser.EqualityExpressionContext): Var? { - var re: Var? = visit(ctx.relationalExpression(0)) - for (i in 1 until ctx.relationalExpression().size) { - val b: Var? = visit(ctx.relationalExpression(i)) - if (ctx.op.text.equals("==")) { - if (re is MCInt && b is MCInt) { - re = re.equalCommand(b) - } else if (re is MCBool && b is MCBool) { - re = re.equalCommand(b) - } - } else { - if (re is MCInt && b is MCInt) { - re = re.notEqualCommand(b) - } else if (re is MCBool && b is MCBool) { - re = re.notEqualCommand(b) - } - } - } - return re - } - - /** - * 计算一个比较表达式,例如a > b - * @param ctx the parse tree - * @return 表达式的值 - */ - @Override - override fun visitRelationalExpression(ctx: mcfppParser.RelationalExpressionContext): Var? { - var re: Var? = visit(ctx.additiveExpression(0)) - if (ctx.additiveExpression().size != 1) { - val b: Var? = visit(ctx.additiveExpression(1)) - if (re is MCInt && b is MCInt) { - when (ctx.relationalOp().text) { - ">" -> re = re.greaterCommand(b) - ">=" -> re = re.greaterOrEqualCommand(b) - "<" -> re = re.lessCommand(b) - "<=" -> re = re.lessOrEqualCommand(b) - } - } else { - TODO() - } - } - return re - } - - /** - * 计算一个加减法表达式,例如a + b - * @param ctx the parse tree - * @return 表达式的值 - */ - @Override - override fun visitAdditiveExpression(ctx: mcfppParser.AdditiveExpressionContext): Var? { - var re: Var? = visit(ctx.multiplicativeExpression(0)) - for (i in 1 until ctx.multiplicativeExpression().size) { - val b: Var? = visit(ctx.multiplicativeExpression(i)) - re = if (Objects.equals(ctx.op.text, "+")) { - if (re is MCInt && b is MCInt) { - re.addCommand(b) - } else { - //TODO - throw TODOException("") - } - } else if (Objects.equals(ctx.op.text, "-")) { - if (re is MCInt && b is MCInt) { - re.minusCommand(b) - } else { - //TODO - throw TODOException("") - } - } else { - return null - } - } - return re - } - - /** - * 计算一个乘除法表达式,例如a * b - * @param ctx the parse tree - * @return 表达式的值 - */ - //乘法 - @Override - override fun visitMultiplicativeExpression(ctx: mcfppParser.MultiplicativeExpressionContext): Var? { - var re: Var? = visit(ctx.unaryExpression(0)) - for (i in 1 until ctx.unaryExpression().size) { - val b: Var? = visit(ctx.unaryExpression(i)) - re = if (Objects.equals(ctx.op.text, "*")) { - if (re is MCInt && b is MCInt) { - re.multipleCommand(b) - } else { - //TODO - throw TODOException("") - } - } else if (Objects.equals(ctx.op.text, "/")) { - if (re is MCInt && b is MCInt) { - re.divideCommand(b) - } else { - //TODO - throw TODOException("") - } - } else if (Objects.equals(ctx.op.text, "%")) { - if (re is MCInt && b is MCInt) { - re.modularCommand(b) - } else { - //TODO - throw TODOException("") - } - } else { - return null - } - } - return re - } - - /** - * 计算一个单目表达式。比如!a 或者 (int)a - * @param ctx the parse tree - * @return 表达式的值 - */ - @Override - override fun visitUnaryExpression(ctx: mcfppParser.UnaryExpressionContext): Var? { - return if (ctx.basicExpression() != null) { - visit(ctx.basicExpression()) - } else if (ctx.unaryExpression() != null) { - val a: Var? = visit(ctx.unaryExpression()) - if (a is MCBool) { - a.opposeCommand() - } else { - throw ArgumentNotMatchException("运算符'!'只能用于bool类型") - } - } else { - //类型强制转换 - visit(ctx.castExpression()) - } - } - - /** - * 计算一个强制转换表达式。 - * @param ctx the parse tree - * @return 表达式的值 - */ - @Override - override fun visitCastExpression(ctx: mcfppParser.CastExpressionContext): Var? { - val a: Var? = visit(ctx.unaryExpression()) - return a!!.cast(ctx.type().text) - } - - /** - * 计算一个基本的表达式。可能是一个变量,也可能是一个数值 - * @param ctx the parse tree - * @return 表达式的值 - */ - //基本表达式 - @Override - override fun visitBasicExpression(ctx: mcfppParser.BasicExpressionContext): Var? { - return if (ctx.primary() != null) { - visit(ctx.primary()) - } else { - //Var With Selector - visit(ctx.varWithSelector()) - } - } - - @Override - override fun visitVarWithSelector(ctx: mcfppParser.VarWithSelectorContext): Var? { - var curr: CanSelectMember - curr = if (ctx.`var`() != null) { - //Var - Function.currFunction!!.getVar(ctx.text) as ClassPointer - } else { - //ClassName - val qwq: Class? = Project.global.cache.classes.getOrDefault(ctx.className().text, null) - if (qwq == null) { - Project.logger.error( - "Undefined class:" + ctx.className().text + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - ClassType(qwq!!) - } - var member: Var? = null - //开始选择 - var i = 0 - while (i < ctx.selector().size) { - member = curr.getVarMember(ctx.selector(i).text.substring(1)) - if (member == null) { - Project.logger.error( - "Undefined member " + ctx.selector(i).text + " in class " + curr.Class()!!.identifier + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - i++ - curr = (member as CanSelectMember?)!! - } - return member - } - - /** - * 一个初级表达式,可能是一个变量,也可能是一个数值 - * @param ctx the parse tree - * @return 表达式的值 - */ - @Override - override fun visitPrimary(ctx: mcfppParser.PrimaryContext): Var? { - if (ctx.`var`() != null) { - //变量 - return visit(ctx.`var`()) - } else { - //数字 - val num: mcfppParser.ValueContext = ctx.value() - if (num.INT() != null) { - return MCInt(Integer.parseInt(num.INT().text)) - } else if (num.STRING() != null) { - val r: String = num.STRING().text - return MCString(r.substring(1, r.length - 1)) - } - } - return null - } - - /** - * 变量 - * @param ctx the parse tree - * @return 变量 - */ - @Override - override fun visitVar(ctx: mcfppParser.VarContext): Var? { - return if (ctx.Identifier() != null) { - // Identifier identifierSuffix* - if (ctx.identifierSuffix() == null || ctx.identifierSuffix().size == 0) { - //没有数组选取 - val qwq: String = ctx.Identifier().text - val re: Var? = Function.currFunction!!.getVar(qwq) - //TODO 从类的成员中选取。待定特性。 - /* - if(re == null && Function.currFunction.Class() != null){ - re = Function.currFunction.Class().getMemberVar(ctx.getText()); - } - */if (re == null) { - Project.logger.error( - "Undefined variable:" + qwq + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - re - } else { - //TODO 是数组调用 - throw TODOException("") - } - } else if (ctx.expression() != null) { - // '(' expression ')' - visit(ctx.expression()) - } else if (ctx.constructorCall() != null) { - // constructorCall - visit(ctx.constructorCall()) - } else { - //TODO - throw TODOException("") - } - } - - @Override - override fun visitConstructorCall(ctx: mcfppParser.ConstructorCallContext): Var? { - val cls: Class? = Project.global.cache.classes.getOrDefault(ctx.className().text, null) - if (cls == null) { - Project.logger.error( - "Undefined class:" + ctx.className().text + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - //获取参数列表 - //参数获取 - val args: ArrayList = ArrayList() - val exprVisitor = McfppExprVisitor() - if (ctx.arguments().expressionList() != null) { - for (expr in ctx.arguments().expressionList().expression()) { - args.add(exprVisitor.visit(expr)!!) - } - } - //如果是native类 - if (cls is NativeClass) { - //创建新实例并返回 - return try { - cls.newInstance(args) - } catch (e: InvocationTargetException) { - Project.logger.error( - "Catch Exception when instantiate native class: " + cls.cls + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.logger.error(e.message + " " + e.cause + "\n") - throw RuntimeException(e) - } catch (e: InstantiationException) { - Project.logger.error( - "Catch Exception when instantiate native class: " + cls.cls + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.logger.error(e.message + " " + e.cause + "\n") - throw RuntimeException(e) - } catch (e: IllegalAccessException) { - Project.logger.error( - "Catch Exception when instantiate native class: " + cls.cls + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.logger.error(e.message + " " + e.cause + "\n") - throw RuntimeException(e) - } catch (e: NoSuchMethodException) { - Project.logger.error( - "Catch Exception when instantiate native class: " + cls.cls + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.logger.error(e.message + " " + e.cause + "\n") - throw RuntimeException(e) - } - } - cls!! - val constructor = cls.getConstructor(FunctionParam.getVarTypes(args)) - if (constructor == null) { - Project.logger.error( - "No constructor like: " + FunctionParam.getVarTypes(args) + " defined in class " + ctx.className() - .text + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - throw FunctionNotDefineException() - } - //调用构造函数 - val obj: ClassObject = cls.newInstance() - constructor.invoke(args, ctx.getStart().line, obj.initPointer) - //调用函数 - return obj - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppFileVisitor.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/McfppFileVisitor.kt deleted file mode 100644 index ccdfedc9..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppFileVisitor.kt +++ /dev/null @@ -1,478 +0,0 @@ -package top.alumopper.mcfpp.lib - -import mcfppBaseVisitor -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.exception.* -import top.alumopper.mcfpp.exception.IllegalFormatException -import top.alumopper.mcfpp.lang.INativeClass -import top.alumopper.mcfpp.lang.Var -import top.alumopper.mcfpp.lang.Var.ConstStatus -import top.alumopper.mcfpp.lib.ClassMember.AccessModifier -import java.util.* - -/** - * 在编译工程之前,应当首先将所有文件中的资源全部遍历一次并写入缓存。 - */ -class McfppFileVisitor : mcfppBaseVisitor() { - /** - * 遍历整个文件。一个文件包含了命名空间的声明,函数的声明,类的声明以及全局变量的声明。全局变量是可以跨文件调用的。 - *
-     * `
-     * compilationUnit
-     * :   namespaceDeclaration?
-     * typeDeclaration *
-     * EOF
-     * ;
-    ` *
-    
* - * @param ctx the parse tree - * @return null - */ - @Override - override fun visitCompilationUnit(ctx: mcfppParser.CompilationUnitContext): Any? { - //命名空间 - if (ctx.namespaceDeclaration() != null) { - Project.currNamespace = ctx.namespaceDeclaration()!!.Identifier().text - } - //文件结构,类和函数 - for (t in ctx.typeDeclaration()) { - visit(t) - } - return null - } - - /** - * 类或者函数的声明 - * @param ctx the parse tree - * @return null - */ - @Override - override fun visitTypeDeclaration(ctx: mcfppParser.TypeDeclarationContext): Any? { - visit(ctx.classOrFunctionDeclaration()) - return null - } - - /** - * 类或函数声明 - *
-     * `classOrFunctionDeclaration
-     * :   classDeclaration
-     * |   functionDeclaration
-     * |   nativeDeclaration
-     * ;`
-    
* - * @param ctx the parse tree - * @return null - */ - @Override - override fun visitClassOrFunctionDeclaration(ctx: mcfppParser.ClassOrFunctionDeclarationContext): Any? { - if (ctx.classDeclaration() != null) { - visit(ctx.classDeclaration()) - } else if (ctx.functionDeclaration() != null) { - visit(ctx.functionDeclaration()) - } else if (ctx.nativeFuncDeclaration() != null) { - visit(ctx.nativeFuncDeclaration()) - } else { - visit(ctx.nativeClassDeclaration()) - } - return null - } - - /** - * native类的声明 - * @param ctx the parse tree - * @return null - */ - override fun visitNativeClassDeclaration(ctx: mcfppParser.NativeClassDeclarationContext): Any? { - //注册类 - val identifier: String = ctx.className().text - return if (Project.global.cache.classes.containsKey(identifier)) { - //重复声明 - Project.logger.error( - "The class has extended " + Class.currClass!!.identifier + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - throw ClassDuplicationException() - } else { - //获取它指向的java类 - val cls: java.lang.Class = try { - java.lang.Class.forName(ctx.javaRefer().text) as java.lang.Class - } catch (e: ClassNotFoundException) { - throw RuntimeException(e) - } catch (e: ClassCastException) { - throw RuntimeException(e) - } - val ncls: NativeClass = if (ctx.className().Identifier() != null) { - //声明了命名空间 - NativeClass(identifier, ctx.className().Identifier().text, cls) - } else { - NativeClass(identifier, cls) - } - Project.global.cache.classes[identifier] = ncls - null - } - } - - /** - * 类的声明 - * @param ctx the parse tree - * @return null - */ - @Override - override fun visitClassDeclaration(ctx: mcfppParser.ClassDeclarationContext): Any? { - //注册类 - val identifier: String = ctx.className(0).text - if (Project.global.cache.classes.containsKey(identifier)) { - //重复声明 - Project.logger.error( - "The class has extended " + Class.currClass!!.identifier + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - throw ClassDuplicationException() - } else { - //如果没有声明过这个类 - val cls: Class = if (ctx.className(0).Identifier() != null) { - //声明了命名空间 - Class(identifier, ctx.className(0).Identifier().text) - } else { - Class(identifier) - } - if (ctx.className().size != 1) { - if (Project.global.cache.classes.containsKey(ctx.className(1).text)) { - cls.parent = Project.global.cache.classes[ctx.className(1).text] - } else { - Project.logger.error( - "Undefined class: " + ctx.className(1).text + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - } - Project.global.cache.classes[identifier] = cls - Class.currClass = cls - cls.isStaticClass = ctx.STATIC() != null - } - //解析类中的成员 - //先静态 - //先解析函数 - for (c in ctx.classBody().staticClassMemberDeclaration()) { - if (c!!.classMember().fieldDeclaration() == null) { - visit(c) - } - } - //再解析变量 - for (c in ctx.classBody().staticClassMemberDeclaration()) { - if (c!!.classMember().fieldDeclaration() != null) { - visit(c) - } - } - //后成员 - //先解析函数和构造函数 - for (c in ctx.classBody().classMemberDeclaration()) { - if (c!!.classMember().fieldDeclaration() == null) { - visit(c) - } - } - //再解析变量 - for (c in ctx.classBody().classMemberDeclaration()) { - if (c!!.classMember().fieldDeclaration() != null) { - visit(c) - } - } - //如果没有构造函数,自动添加默认的空构造函数 - if (Class.currClass!!.constructors.size == 0) { - Class.currClass!!.addConstructor(Constructor(Class.currClass!!)) - } - Class.currClass = null - return null - } - - @Override - override fun visitStaticClassMemberDeclaration(ctx: mcfppParser.StaticClassMemberDeclarationContext): Any? { - val m = visit(ctx.classMember()) as ClassMember - //访问修饰符 - if (ctx.accessModifier() != null) { - m.accessModifier = AccessModifier.valueOf(ctx.accessModifier().text.uppercase(Locale.getDefault())) - } - m.isStatic = true - Class.currClass!!.addMember(m) - return null - } - - /** - * 类成员的声明。由于函数声明可以后置,因此需要先查明函数声明情况再进行变量的注册以及初始化。 - *
-     * `classMemberDeclaration
-     * :   accessModifier? (STATIC)? classMember
-     * ;
-    `
* - * @param ctx the parse tree - * @return null - */ - @Override - override fun visitClassMemberDeclaration(ctx: mcfppParser.ClassMemberDeclarationContext): Any? { - val m = visit(ctx.classMember()) as ClassMember - //访问修饰符 - if (ctx.accessModifier() != null) { - m.accessModifier = AccessModifier.valueOf(ctx.accessModifier().text.uppercase(Locale.getDefault())) - } - if (m !is Constructor) { - Class.currClass!!.addMember(m) - } - return null - } - - @Override - override fun visitClassMember(ctx: mcfppParser.ClassMemberContext): Any? { - return if (ctx.nativeFuncDeclaration() != null) { - visit(ctx.nativeFuncDeclaration()) - } else if (ctx.classFunctionDeclaration() != null) { - visit(ctx.classFunctionDeclaration()) - } else if (ctx.fieldDeclaration() != null) { - visit(ctx.fieldDeclaration()) - } else if (ctx.constructorDeclaration() != null) { - visit(ctx.constructorDeclaration()) - } else { - visit(ctx.nativeConstructorDeclaration()) - } - } - - /** - * 类方法的声明 - * @param ctx the parse tree - * @return 这个类方法的对象 - */ - @Override - override fun visitClassFunctionDeclaration(ctx: mcfppParser.ClassFunctionDeclarationContext): Any { - //创建函数对象 - val f = Function( - ctx.Identifier().text, - Class.currClass!!, - ctx.parent is mcfppParser.StaticClassMemberDeclarationContext - ) - //解析参数 - if (ctx.parameterList() != null) { - f.addParams(ctx.parameterList()) - } - //注册函数 - if (Class.currClass!!.cache!!.functions.contains(f) || Class.currClass!!.staticCache!!.functions.contains( - f - ) - ) { - Project.logger.error( - "Already defined function:" + ctx.Identifier() - .text + "in class " + Class.currClass!!.identifier + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - Function.currFunction = Function.nullFunction - } - return f - } - - /** - * 构造函数的声明 - * @param ctx the parse tree - * @return 这个构造函数的对象 - */ - @Override - override fun visitConstructorDeclaration(ctx: mcfppParser.ConstructorDeclarationContext): Any? { - //是构造函数 - //创建构造函数对象,注册函数 - var f: Constructor? = null - try { - f = Constructor(Class.currClass!!) - Class.currClass!!.addConstructor(f) - } catch (e: FunctionDuplicationException) { - Project.logger.error( - "Already defined function: " + ctx.className().text + "(" + ctx.parameterList().text + ")" + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } - assert(f != null) - if (ctx.parameterList() != null) { - f!!.addParams(ctx.parameterList()) - } - return f - } - - @Override - override fun visitNativeConstructorDeclaration(ctx: mcfppParser.NativeConstructorDeclarationContext?): Any? { - //TODO - throw TODOException("") - } - - /** - * 函数的声明 - * @param ctx the parse tree - * @return null - */ - @Override - override fun visitFunctionDeclaration(ctx: mcfppParser.FunctionDeclarationContext): Any? { - //创建函数对象 - val f: Function - //是否是内联函数 - //是否是内联函数 - if (ctx.INLINE() == null) { - //获取函数的文本内容 - //函数是否拥有命名空间声明 - f = if (ctx.namespaceID().Identifier().size == 1) { - InlineFunction(ctx.namespaceID().Identifier(0).text, ctx) - } else { - InlineFunction( - ctx.namespaceID().Identifier(0).text, - ctx.namespaceID().Identifier(1).text, - ctx - ) - } - } else { - //函数是否拥有命名空间声明 - f = if (ctx.namespaceID().Identifier().size == 1) { - Function(ctx.namespaceID().Identifier(0).text) - } else { - Function(ctx.namespaceID().Identifier(0).text, ctx.namespaceID().Identifier(1).text) - } - } - //解析参数 - if (ctx.parameterList() != null) { - f.addParams(ctx.parameterList()) - } - //解析函数的tag - if (ctx.functionTag() != null) { - val functionTag: FunctionTag = if (ctx.functionTag()!!.namespaceID().Identifier().size == 1) { - FunctionTag(FunctionTag.MINECRAFT, ctx.functionTag()!!.namespaceID().Identifier(0).text) - } else { - FunctionTag( - ctx.functionTag()!!.namespaceID().Identifier(0).text, - ctx.functionTag()!!.namespaceID().Identifier(1).text - ) - } - if (Project.global.functionTags.containsKey(functionTag.namespaceID)) { - f.tag = Project.global.functionTags[functionTag.namespaceID] - } else { - Project.global.functionTags[functionTag.namespaceID] = functionTag - f.tag = functionTag - } - f.tag!!.cache.functions.add(f) - } - //不是类的成员 - f.isClassMember = false - if (Project.global.cache.getFunction(f.namespace, f.name, f.paramTypeList) == null) { - Project.global.cache.functions.add(f) - } else { - Project.logger.error( - "Already defined function:" + f.namespaceID + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - Function.currFunction = Function.nullFunction - } - if (f.tag != null && (f.tag!! == FunctionTag.TICK || f.tag!! == FunctionTag.LOAD) && (ctx.parent as mcfppParser.FunctionDeclarationContext).parameterList()!! - .parameter().size != 0 - ) { - Project.logger.error( - "Entrance function shouldn't have parameter:" + f.namespaceID + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - } - return null - } - - /** - * native函数的声明 - * @param ctx the parse tree - * @return 如果是全局,返回null,否则返回这个函数对象 - */ - @Override - override fun visitNativeFuncDeclaration(ctx: mcfppParser.NativeFuncDeclarationContext): Any? { - val nf: NativeFunction = try { - NativeFunction(ctx.Identifier().text, ctx.javaRefer()) - } catch (e: IllegalFormatException) { - Project.logger.error( - "Illegal Java Method Name:" + e.message + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - return null - } catch (e: ClassNotFoundException) { - Project.logger.error( - "Cannot find java class:" + e.message + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - return null - } catch (e: NoSuchMethodException) { - Project.logger.error( - "No such method:" + e.message + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - return null - } - if (ctx.parameterList() != null) { - nf.addParams(ctx.parameterList()) - } - if (Class.currClass == null) { - //是普通的函数 - nf.isClassMember = false - if (!Project.global.cache.functions.contains(nf)) { - Project.global.cache.functions.add(nf) - } else { - Project.logger.error( - "Already defined function:" + ctx.Identifier().text + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - Function.currFunction = Function.nullFunction - } - return nf - } - //是类成员 - nf.isClassMember = true - nf.parentClass = Class.currClass - return nf - } - - /** - * 类字段的声明 - * @param ctx the parse tree - * @return null - */ - @Override - override fun visitFieldDeclaration(ctx: mcfppParser.FieldDeclarationContext): Any { - //变量生成 - val `var`: Var = Var.build(ctx, Class.currClass!!)!! - //只有可能是类变量 - if (Class.currClass!!.cache!!.containVar( - ctx.Identifier().text - ) || Class.currClass!!.staticCache!!.containVar(ctx.Identifier().text) - ) { - Project.logger.error( - "Duplicate defined variable name:" + ctx.Identifier().text + - " at " + Project.currFile.name + " line:" + ctx.getStart().line - ) - Project.errorCount++ - throw VariableDuplicationException() - } - //变量的初始化 - if (ctx.expression() != null) { - `var`.isConst = ConstStatus.ASSIGNED - Function.currFunction = Class.currClass!!.classPreInit!! - Function.addCommand("#" + ctx.text) - val init: Var = McfppExprVisitor().visit(ctx.expression())!! - try { - `var`.assign(init) - } catch (e: VariableConverseException) { - Project.logger.error( - "Cannot convert " + init.javaClass + " to " + `var`.javaClass + - " at " + Class.currClass!!.identifier + " line:" + ctx.getStart().line - ) - Project.errorCount++ - Function.currFunction = Function.nullFunction - throw VariableConverseException() - } - Function.currFunction = Function.nullFunction - } - return `var` - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppFuncVisitor.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/McfppFuncVisitor.kt deleted file mode 100644 index db9b6e5a..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppFuncVisitor.kt +++ /dev/null @@ -1,28 +0,0 @@ -package top.alumopper.mcfpp.lib - -import mcfppBaseVisitor -import top.alumopper.mcfpp.Project - -/** - * 获取函数用的visitor - */ -class McfppFuncVisitor : mcfppBaseVisitor() { - fun getFunction(ctx: mcfppParser.FunctionCallContext, args: ArrayList): Function? { - return if (ctx.namespaceID() != null && ctx.basicExpression() == null) { - val qwq: Function? = if (ctx.namespaceID().Identifier().size == 1) { - Project.global.cache.getFunction(Project.currNamespace, ctx.namespaceID().Identifier(0).text, args) - } else { - Project.global.cache.getFunction( - ctx.namespaceID().Identifier(0).text, - ctx.namespaceID().Identifier(1).text, - args - ) - } - qwq - } else if (ctx.basicExpression() != null) { - TODO() - } else { - TODO() - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppImListener.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/McfppImListener.kt deleted file mode 100644 index 90a57a53..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/McfppImListener.kt +++ /dev/null @@ -1,741 +0,0 @@ -package top.alumopper.mcfpp.lib - -import mcfppBaseListener -import org.antlr.v4.runtime.RuleContext -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.command.Commands -import top.alumopper.mcfpp.exception.* -import top.alumopper.mcfpp.lang.* - -class McfppImListener : mcfppBaseListener() { - /** - * 进入一个函数体 - * @param ctx the parse tree - */ - @Override - override fun enterFunctionBody(ctx: mcfppParser.FunctionBodyContext) { - var f: Function - //获取函数对象 - if (ctx.parent.parent !is mcfppParser.ClassMemberContext) { - //不是类成员 - //创建函数对象 - val parent: mcfppParser.FunctionDeclarationContext = ctx.parent as mcfppParser.FunctionDeclarationContext - f = if (parent.namespaceID().Identifier().size == 1) { - Function(parent.namespaceID().Identifier(0).text) - } else { - Function( - parent.namespaceID().Identifier(0).text, - parent.namespaceID().Identifier(1).text - ) - } - //解析参数 - if (parent.parameterList() != null) { - f.addParams((ctx.parent as mcfppParser.FunctionDeclarationContext).parameterList()) - } - //获取缓存中的对象 - f = Project.global.cache.getFunction(f.namespace, f.name, f.paramTypeList)!! - } else if (ctx.parent is mcfppParser.ConstructorDeclarationContext) { - //是构造函数 - //创建构造函数对象并解析参数 - val temp = Function("temp") - if ((ctx.parent as mcfppParser.ConstructorDeclarationContext).parameterList() != null) { - temp.addParams((ctx.parent as mcfppParser.ConstructorDeclarationContext).parameterList()) - } - //获取缓存中的对象 - f = Class.currClass!!.getConstructor(FunctionParam.toStringList(temp.params))!! - } else { - //是类的成员函数 - //创建函数对象并解析参数 - val qwq: mcfppParser.ClassFunctionDeclarationContext = ctx.parent as mcfppParser.ClassFunctionDeclarationContext - f = Function(qwq.Identifier().text, Class.currClass!!, false) - if (qwq.parameterList() != null) { - f.addParams(qwq.parameterList()) - } - //获取缓存中的对象 - f = Class.currClass!!.cache!!.getFunction(f.namespace, f.name, f.paramTypeList)!! - } - Function.currFunction = f - } - - /** - * 离开一个函数体 - * @param ctx the parse tree - */ - @Override - override fun exitFunctionBody(ctx: mcfppParser.FunctionBodyContext?) { - if (Class.currClass == null) { - //不在类中 - Function.currFunction = Function.nullFunction - } else { - Function.currFunction = Class.currClass!!.classPreInit - } - } - - /** - * 进入命名空间声明的时候 - * @param ctx the parse tree - */ - @Override - override fun exitNamespaceDeclaration(ctx: mcfppParser.NamespaceDeclarationContext) { - Project.currNamespace = ctx.Identifier().text - } - - /** - * 变量声明 - * @param ctx the parse tree - */ - @Override - override fun exitFieldDeclaration(ctx: mcfppParser.FieldDeclarationContext) { - //变量生成 - - //变量生成 - val `var`: Var = if (ctx.parent is mcfppParser.ClassMemberContext) { - return - } else { - //函数变量,生成 - Var.build(ctx, Function.currFunction)!! - } - //变量注册 - //一定是函数变量 - if (!Function.currFunction.cache.putVar(ctx.Identifier().text, `var`)) { - Project.logger.error( - "Duplicate defined variable name:" + ctx.Identifier().text + - " at " + Project.currFile.name + " line:" + ctx.getStart().line - ) - Project.errorCount++ - throw VariableDuplicationException() - } - Function.addCommand( - "#" + ctx.type().text + " " + ctx.Identifier() - .text + if (ctx.expression() != null) " = " + ctx.expression().text else "" - ) - //变量初始化 - if (ctx.expression() != null) { - val init: Var = McfppExprVisitor().visit(ctx.expression())!! - try { - `var`.assign(init) - } catch (e: VariableConverseException) { - Project.logger.error( - "Cannot convert " + init.javaClass + " to " + `var`.javaClass + - " at " + Function.currFunction.GetID() + " line:" + ctx.getStart().line - ) - Project.errorCount++ - throw VariableConverseException() - } - } - } - - /** - * 一个赋值的语句 - * @param ctx the parse tree - */ - @Override - override fun exitStatementExpression(ctx: mcfppParser.StatementExpressionContext) { - Function.addCommand("#" + ctx.text) - val left: Var = McfppExprVisitor().visit(ctx.basicExpression())!! - if (left.isConst == Var.ConstStatus.ASSIGNED) { - Project.logger.error( - "Cannot assign a constant repeatedly: " + left.key + - " at " + Function.currFunction.GetID() + " line:" + ctx.getStart().line - ) - Project.errorCount++ - throw ConstChangeException() - } else if (left.isConst == Var.ConstStatus.NULL) { - left.isConst = Var.ConstStatus.ASSIGNED - } - val right: Var = McfppExprVisitor().visit(ctx.expression())!! - try { - left.assign(right) - } catch (e: VariableConverseException) { - Project.logger.error( - "Cannot convert " + right.javaClass + " to " + left.javaClass + - " at " + Function.currFunction.GetID() + " line:" + ctx.getStart().line - ) - Project.errorCount++ - throw VariableConverseException() - } - } - - /** - * 自加或自减语句 - * @param ctx the parse tree - */ - @Override - override fun exitSelfAddOrMinusStatement(ctx: mcfppParser.SelfAddOrMinusStatementContext) { - Function.addCommand("#" + ctx.text) - val re: Var? = Function.currFunction.getVar(ctx.selfAddOrMinusExpression().Identifier().text) - if (re == null) { - Project.logger.error( - "Undefined variable:" + ctx.selfAddOrMinusExpression().Identifier().text + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - Project.errorCount++ - throw VariableNotDefineException() - } - if (ctx.selfAddOrMinusExpression().op.text.equals("++")) { - if (re is MCInt) { - if (re.isConcrete) { - re.value = re.value!! + 1 - } else { - Function.addCommand(Commands.SbPlayerAdd(re, 1)) - } - } - } else { - if (re is MCInt) { - if (re.isConcrete) { - re.value = re.value!! - 1 - } else { - Function.addCommand(Commands.SbPlayerRemove(re, 1)) - } - } - } - } - - /** - * 调用一个函数。参考: - * [[命令] [数据包] 局部变量、程序控制流程在数据包中的实现 借助汇编语言函数堆栈思想 - mcbbs](https://www.mcbbs.net/thread-1393132-1-1.html) - * @param ctx the parse tree - */ - @Override - override fun exitFunctionCall(ctx: mcfppParser.FunctionCallContext) { - Function.addCommand("#" + ctx.text) - //参数获取 - val args: ArrayList = ArrayList() - val exprVisitor = McfppExprVisitor() - for (expr in ctx.arguments().expressionList().expression()) { - args.add(exprVisitor.visit(expr)!!) - } - //函数对象获取 - val curr = McfppFuncVisitor().getFunction(ctx, FunctionParam.getVarTypes(args)) - if (curr == null) { - Project.logger.error( - "Function " + ctx.text + " not defined " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - throw FunctionNotDefineException() - } - if (curr is NativeFunction) { - //是native方法 - if (curr.isClassMember) { - //TODO - throw TODOException("") - } else { - curr.invoke(args, ctx.getStart().line) - } - return - } - curr.invoke(args, ctx.getStart().line) - //函数树 - Function.currFunction.child.add(curr) - curr.parent.add(Function.currFunction) - } - - var lastBool: MCBool? = null //if语句的条件 - //TODO 条件判断语句实现方式与参考文章有出入,可能存在bug - /** - * 进入if语句块 - * @param ctx the parse tree - */ - @Override - override fun enterIfBlock(ctx: mcfppParser.IfBlockContext) { - Function.addCommand("#if start") - val parent: mcfppParser.IfStatementContext = ctx.parent as mcfppParser.IfStatementContext - //是if语句,获取参数 - val index: Int = parent.ifBlock().indexOf(ctx) - //匿名函数的定义 - val f: Function = InternalFunction("_if_", Function.currFunction) - Project.global.cache.functions.add(f) - if (index == 0) { - //第一个if - val exp: MCBool = McfppExprVisitor().visit(parent.expression()) as MCBool - if (exp.isConcrete && exp.value) { - //函数调用的命令 - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand(Commands.Function(f)) - Project.logger.warn( - "The condition is always true. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else if (exp.isConcrete) { - Function.addCommand("#" + Commands.Function(f)) - Project.logger.warn( - "The condition is always false. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "if score " + exp.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(f) - ) - } - lastBool = exp - } else { - //else语句 - Function.addCommand( - "execute " + - "unless score " + lastBool!!.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(f) - ) - } - Function.currFunction = f - } - - /** - * 离开if语句块 - * @param ctx the parse tree - */ - @Override - override fun exitIfBlock(ctx: mcfppParser.IfBlockContext?) { - Function.currFunction = Function.currFunction.parent[0] - //调用完毕,将子函数的栈销毁 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.addCommand("#if end") - } - - /** - * 进入else-if语句块 - * @param ctx the parse tree - */ - @Override - override fun enterElseIfStatement(ctx: mcfppParser.ElseIfStatementContext) { - Function.addCommand("#else if start") - //匿名函数的定义 - val f: Function = InternalFunction("_if_", Function.currFunction) - Project.global.cache.functions.add(f) - if (lastBool!!.isConcrete && !lastBool!!.value) { - //函数调用的命令 - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand("#" + Commands.Function(f)) - Project.logger.warn( - "The condition is always false. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else if (lastBool!!.isConcrete) { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand(Commands.Function(f)) - Project.logger.warn( - "The condition is always true. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "unless score " + lastBool!!.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(f) - ) - } - lastBool = null - Function.currFunction = f - } - - /** - * 离开else-if语句块 - * @param ctx the parse tree - */ - @Override - override fun exitElseIfStatement(ctx: mcfppParser.ElseIfStatementContext?) { - Function.currFunction = Function.currFunction.parent[0] - //调用完毕,将子函数的栈销毁 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.addCommand("#else if end") - } - - /** - * 进入while语句块 - * @param ctx the parse tree - */ - @Override - override fun enterWhileBlock(ctx: mcfppParser.WhileBlockContext) { - Function.addCommand("#while start") - val parent: mcfppParser.WhileStatementContext = ctx.parent as mcfppParser.WhileStatementContext - val exp: MCBool = McfppExprVisitor().visit(parent.expression()) as MCBool - //匿名函数的定义 - val f: Function = InternalFunction("_while_", Function.currFunction) - f.child.add(f) - f.parent.add(f) - Project.global.cache.functions.add(f) - if (exp.isConcrete && exp.value) { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand(Commands.Function(f)) - Project.logger.warn( - "The condition is always true. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else if (exp.isConcrete) { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand("#" + Commands.Function(f)) - Project.logger.warn( - "The condition is always false. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "if score " + exp.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(f) - ) - } - //调用完毕,将子函数的栈销毁 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.currFunction = f //后续块中的命令解析到递归的函数中 - } - - /** - * 离开while语句块 - * @param ctx the parse tree - */ - @Override - override fun exitWhileBlock(ctx: mcfppParser.WhileBlockContext) { - if (!Function.isBreak && Function.isLastFunctionEnd != 0) { - Function.currFunction = Function.currFunction.parent[0] - } - //递归调用函数 - //重新计算表达式 - val parent: mcfppParser.WhileStatementContext = ctx.parent as mcfppParser.WhileStatementContext - val exp: MCBool = McfppExprVisitor().visit(parent.expression()) as MCBool - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "if score " + exp.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(Function.currFunction) - ) - //调用完毕,将子函数的栈销毁 - Function.currFunction = Function.currFunction.parent[0] - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.addCommand("#while end") - } - - /** - * 进入do-while语句块,开始匿名函数调用 - * @param ctx the parse tree - */ - @Override - override fun enterDoWhileBlock(ctx: mcfppParser.DoWhileBlockContext?) { - Function.addCommand("#do while start") - //匿名函数的定义 - val f: Function = InternalFunction("_dowhile_", Function.currFunction) - f.child.add(f) - f.parent.add(f) - Project.global.cache.functions.add(f) - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand(Commands.Function(f)) - //调用完毕,将子函数的栈销毁 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.currFunction = f //后续块中的命令解析到递归的函数中 - } - - /** - * 离开do-while语句 - * @param ctx the parse tree - */ - @Override - override fun exitDoWhileStatement(ctx: mcfppParser.DoWhileStatementContext) { - val exp: MCBool = McfppExprVisitor().visit(ctx.expression()) as MCBool - if (exp.isConcrete && exp.value) { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand(Commands.Function(Function.currFunction)) - Project.logger.warn( - "The condition is always true. " + - " at " + Project.currFile.name + " line: " + ctx.getStop().line - ) - } else if (exp.isConcrete) { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand("#" + Commands.Function(Function.currFunction)) - Project.logger.warn( - "The condition is always false. " + - " at " + Project.currFile.name + " line: " + ctx.getStop().line - ) - } else { - //给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "if score " + exp.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(Function.currFunction) - ) - } - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - //调用完毕,将子函数的栈销毁 - Function.currFunction = Function.currFunction.parent[0] - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.addCommand("#do while end") - } - - /** - * 整个for语句本身额外有一个栈,无条件调用函数 - * @param ctx the parse tree - */ - @Override - override fun enterForStatement(ctx: mcfppParser.ForStatementContext?) { - Function.addCommand("#for start") - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - val forFunc: Function = InternalFunction("_for_", Function.currFunction) - forFunc.parent.add(Function.currFunction) - Project.global.cache.functions.add(forFunc) - Function.addCommand(Commands.Function(forFunc)) - Function.currFunction = forFunc - } - - @Override - override fun exitForStatement(ctx: mcfppParser.ForStatementContext?) { - Function.currFunction = Function.currFunction.parent[0] - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.addCommand("#for end") - } - - /** - * 进入for update语句块。 - * 由于在编译过程中,编译器会首先编译for语句的for control部分,也就是for后面的括号,这就意味着forUpdate语句将会先forBlock - * 被写入到命令函数中。因此我们需要将forUpdate语句中的命令临时放在一个函数内部,然后在forBlock调用完毕后加上中间的命令 - * - * - * 值得注意的是,for update和for block相对于整个父函数的栈的位置应该是相同的,如果它们想要调用父函数中声明的变量,都应该 - * 用索引[1]来访问,因此可以直接将for update中的命令转移到for block中而不会出现任何问题。 - * - * @param ctx the parse tree - */ - @Override - override fun enterForUpdate(ctx: mcfppParser.ForUpdateContext?) { - Function.currFunction = InternalFunction("_forblock_", Function.currFunction) - } - - var forupdate: Function? = null - - /** - * 离开for update。将for update缓存,同时切换当前函数为父函数 - * @param ctx the parse tree - */ - @Override - override fun exitForUpdate(ctx: mcfppParser.ForUpdateContext?) { - forupdate = Function.currFunction - Function.currFunction = forupdate!!.parent[0] - } - - /** - * 进入for block语句。此时当前函数为父函数 - * @param ctx the parse tree - */ - @Override - override fun enterForBlock(ctx: mcfppParser.ForBlockContext) { - val parent: mcfppParser.ForStatementContext = ctx.parent as mcfppParser.ForStatementContext - val exp: MCBool = McfppExprVisitor().visit(parent.forControl().expression()) as MCBool - //匿名函数的定义。这里才是正式的for函数哦喵 - val f: Function = InternalFunction("_forblock_", Function.currFunction) - f.child.add(f) - f.parent.add(f) - Project.global.cache.functions.add(f) - if (exp.isConcrete && exp.value) { - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand(Commands.Function(f)) - Project.logger.warn( - "The condition is always true. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else if (exp.isConcrete) { - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand("#" + Commands.Function(f)) - Project.logger.warn( - "The condition is always false. " + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } else { - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "if score " + exp.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(f) - ) - } - //调用完毕,将子函数的栈销毁。这条命令仍然是在for函数中的。 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.currFunction = f //后续块中的命令解析到递归的函数中 - } - - /** - * 离开for block语句。此时当前函数仍然是for的函数 - * @param ctx the parse tree - */ - @Override - override fun exitForBlock(ctx: mcfppParser.ForBlockContext) { - //for update的命令压入 - Function.currFunction.commands.addAll(forupdate!!.commands) - forupdate = null - //递归调用函数 - //重新计算表达式 - val parent: mcfppParser.ForStatementContext = ctx.parent as mcfppParser.ForStatementContext - val exp: MCBool = McfppExprVisitor().visit(parent.forControl().expression()) as MCBool - //这里就需要给子函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "if score " + exp.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(Function.currFunction) - ) - //调用完毕,将子函数的栈销毁 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.currFunction = Function.currFunction.parent[0] - } - - @Override - override fun exitOrgCommand(ctx: mcfppParser.OrgCommandContext) { - Function.addCommand(ctx.text.substring(1)) - } - - /** - * 进入任意语句,检查此函数是否还能继续添加语句 - * @param ctx the parse tree - */ - @Override - override fun enterStatement(ctx: mcfppParser.StatementContext) { - if (Function.currFunction.isEnd) { - Project.logger.warn( - "Unreachable code: " + ctx.text + - " at " + Project.currFile.name + " line: " + ctx.getStart().line - ) - } - if (Function.isLastFunctionEnd == 1) { - //循环经历了break语句的洗礼,后面的语句需要全部放在匿名函数中。 - Function.addCommand("#" + (if (Function.isBreak) "break" else "continue") + " function") - //匿名函数的定义 - val f: Function = InternalFunction( - "_" + (if (Function.isBreak) "break" else "continue") + "_", - Function.currFunction - ) - f.child.add(f) - f.parent.add(f) - Project.global.cache.functions.add(f) - //给函数开栈 - Function.addCommand("data modify storage mcfpp:system " + Project.name + ".stack_frame prepend value {}") - Function.addCommand( - "execute " + - "unless score " + temp!!.identifier + " " + SbObject.MCS_boolean + " matches 1 " + - "run " + Commands.Function(f) - ) - //调用完毕,将子函数的栈销毁 - Function.addCommand("data remove storage mcfpp:system " + Project.name + ".stack_frame[0]") - Function.currFunction = f //后续块中的命令解析到递归的函数中 - } - } - - private var temp: MCBool? = null - @Override - override fun exitControlStatement(ctx: mcfppParser.ControlStatementContext) { - if (!inLoopStatement(ctx)) { - Project.logger.error( - "'continue' or 'break' can only be used in loop statements: " + - " at " + Project.currFile.getName() + " line: " + ctx.getStart().line - ) - throw SyntaxException() - } - if (Function.currFunction.isEnd || Function.isLastFunctionEnd != 0) { - return - } - Function.addCommand("#" + ctx.text) - temp = MCBool() - //变量进栈 - Function.addCommand("scoreboard players set " + temp!!.identifier + " " + SbObject.MCS_boolean + " = " + 1) - Function.currFunction.isEnd = true - Function.isLastFunctionEnd = 1 - if (ctx.BREAK() != null) { - Function.isBreak = true - } - } - - /** - * 离开任意代码块。主要用于break语句和continue语句的匿名函数出栈判定。 - * @param ctx the parse tree - */ - @Override - override fun exitBlock(ctx: mcfppParser.BlockContext) { - if (!Function.currFunction.isEnd && Function.isLastFunctionEnd == 2) { - if (ctx.parent is mcfppParser.IfBlockContext) { - //如果是if语句,出栈 - Function.currFunction = Function.currFunction.parent.get(0) - Function.isLastFunctionEnd = 1 - } - if (ctx.parent is mcfppParser.ForBlockContext - || ctx.parent is mcfppParser.WhileBlockContext - || ctx.parent is mcfppParser.DoWhileBlockContext - ) { - //是循环语句,出栈的同时重置isLastFunctionEnd标志 - Function.currFunction = Function.currFunction.parent.get(0) - Function.isLastFunctionEnd = 0 - } - } - } - - /** - * 进入类体。 - * @param ctx the parse tree - */ - @Override - override fun enterClassBody(ctx: mcfppParser.ClassBodyContext) { - //获取类的对象 - val parent: mcfppParser.ClassDeclarationContext = ctx.parent as mcfppParser.ClassDeclarationContext - val identifier: String = parent.className(0).text - //设置作用域 - Class.currClass = Project.global.cache.classes[identifier] - Function.currFunction = Class.currClass!!.classPreInit - } - - /** - * 离开类体。将缓存重新指向全局 - * @param ctx the parse tree - */ - @Override - override fun exitClassBody(ctx: mcfppParser.ClassBodyContext?) { - Class.currClass = null - Function.currFunction = Function.nullFunction - } - - /** - * 类成员的声明 - * @param ctx the parse tree - */ - @Override - override fun exitClassMemberDeclaration(ctx: mcfppParser.ClassMemberDeclarationContext) { - val memberContext: mcfppParser.ClassMemberContext = ctx.classMember() - if (memberContext.classFunctionDeclaration() != null) { - //函数声明由函数的listener处理 - return - } - } - - companion object { - /** - * 判断这个语句是否在循环语句中。包括嵌套形式。 - * @param ctx 需要判断的语句 - * @return 是否在嵌套中 - */ - private fun inLoopStatement(ctx: RuleContext): Boolean { - if (ctx is mcfppParser.ForStatementContext) { - return true - } - if (ctx is mcfppParser.DoWhileStatementContext) { - return true - } - if (ctx is mcfppParser.WhileStatementContext) { - return true - } - return if (ctx.parent != null) { - inLoopStatement(ctx.parent) - } else false - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/Native.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/Native.kt deleted file mode 100644 index fa956c0e..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/Native.kt +++ /dev/null @@ -1,3 +0,0 @@ -package top.alumopper.mcfpp.lib - -interface Native \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/NativeClass.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/NativeClass.kt deleted file mode 100644 index a1e3e5bb..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/NativeClass.kt +++ /dev/null @@ -1,31 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.Project -import top.alumopper.mcfpp.lang.* -import java.lang.reflect.InvocationTargetException -import java.lang.Class - -/** - * 代表了mcfpp中声明的一个native类 - */ -class NativeClass(identifier: String, namespace: String, cls: Class) : top.alumopper.mcfpp.lib.Class(), Native { - var cls: Class - - constructor(identifier: String, cls: Class) : this(identifier, Project.currNamespace, cls) - - init { - this.identifier = identifier - this.namespace = namespace - this.cls = cls - } - - @Throws( - InvocationTargetException::class, - NoSuchMethodException::class, - InstantiationException::class, - IllegalAccessException::class - ) - fun newInstance(args: ArrayList): NativeClassObject { - return NativeClassObject(this, args) - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/NativeConstructor.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/NativeConstructor.kt deleted file mode 100644 index 9f660c85..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/NativeConstructor.kt +++ /dev/null @@ -1,11 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.lang.ClassPointer -import top.alumopper.mcfpp.lang.Var - -class NativeConstructor(cls: Class) : Constructor(cls), Native { - @Override - override operator fun invoke(args: ArrayList, lineNo: Int, cls: ClassPointer) { - TODO() - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/lib/NativeFunction.kt b/src/main/kotlin/top/alumopper/mcfpp/lib/NativeFunction.kt deleted file mode 100644 index aa548b21..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/lib/NativeFunction.kt +++ /dev/null @@ -1,78 +0,0 @@ -package top.alumopper.mcfpp.lib - -import top.alumopper.mcfpp.exception.IllegalFormatException -import top.alumopper.mcfpp.lang.ClassPointer -import top.alumopper.mcfpp.lang.Var -import java.lang.reflect.InvocationTargetException -import java.lang.reflect.Method -import java.lang.Class - -/** - * 表示了一个native方法 - */ -class NativeFunction(name: String, javaMethod: mcfppParser.JavaReferContext?) : Function(name), Native { - /** - * native方法引用的java方法的词法上下文 - */ - var javaReferContext: mcfppParser.JavaReferContext? - - /** - * 要调用的java方法 - */ - var javaMethod: Method - - /** - * 引用的java方法的类名。包含包路径 - */ - var javaClassName: String - - /** - * 引用的java方法的参数名。 - */ - var javaMethodName: String - - init { - javaReferContext = javaMethod - val strs: List = javaMethod!!.stringName() - try { - javaMethodName = strs[strs.size - 1].text - javaClassName = javaMethod.text.substring(0, javaMethod.text.lastIndexOf(javaMethodName) - 1) - } catch (e: StringIndexOutOfBoundsException) { - throw IllegalFormatException(javaReferContext!!.text) - } - try{ - val cls: Class<*> = Class.forName(javaClassName) - this.javaMethod = cls.getMethod(javaMethodName, Array::class.java, ClassPointer::class.java) - } catch (e: NoSuchMethodException) { - throw NoSuchMethodException(javaMethodName) - } catch (e: ClassNotFoundException) { - throw ClassNotFoundException(javaClassName) - } - } - - @Override - override operator fun invoke(args: ArrayList, lineNo: Int) { - val argsArray = arrayOfNulls(args.size) - args.toArray(argsArray) - try { - javaMethod.invoke(null, argsArray, null) - } catch (e: IllegalAccessException) { - throw RuntimeException(e) - } catch (e: InvocationTargetException) { - throw RuntimeException(e) - } - } - - @Override - override operator fun invoke(args: ArrayList, lineNo: Int, cls: ClassPointer) { - val argsArray = arrayOfNulls(args.size) - args.toArray(argsArray) - try { - javaMethod.invoke(null, argsArray, cls) - } catch (e: IllegalAccessException) { - throw RuntimeException(e) - } catch (e: InvocationTargetException) { - throw RuntimeException(e) - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/alumopper/mcfpp/package-info.kt b/src/main/kotlin/top/alumopper/mcfpp/package-info.kt deleted file mode 100644 index 72660f8f..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/package-info.kt +++ /dev/null @@ -1,2 +0,0 @@ -package top.alumopper.mcfpp - diff --git a/src/main/kotlin/top/alumopper/mcfpp/test/NativeTest1.kt b/src/main/kotlin/top/alumopper/mcfpp/test/NativeTest1.kt deleted file mode 100644 index f9b1a79a..00000000 --- a/src/main/kotlin/top/alumopper/mcfpp/test/NativeTest1.kt +++ /dev/null @@ -1,20 +0,0 @@ -package top.alumopper.mcfpp.test - -import top.alumopper.mcfpp.lang.ClassPointer -import top.alumopper.mcfpp.lang.INativeClass -import top.alumopper.mcfpp.lang.Var - -class NativeTest1(vars: Array?, cls: ClassPointer?) : INativeClass(vars, cls) { - init { - System.out.println("MNI > Create new Instance!") - } - - companion object { - fun test(vars: Array, cls: ClassPointer?) { - System.out.println("MNI > Hello Minecraft!") - for (v in vars) { - System.out.println("MNI > Get argument " + v.identifier) - } - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/CompileSettings.kt b/src/main/kotlin/top/mcfpp/CompileSettings.kt new file mode 100644 index 00000000..7c5b1e3f --- /dev/null +++ b/src/main/kotlin/top/mcfpp/CompileSettings.kt @@ -0,0 +1,13 @@ +package top.mcfpp + +object CompileSettings { + /** + * 是否是debug模式 + */ + var isDebug : Boolean = false + + /** + * 是否忽略标准库 + */ + var ignoreStdLib: Boolean = false +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/MCFPP.kt b/src/main/kotlin/top/mcfpp/MCFPP.kt new file mode 100644 index 00000000..dec43eb6 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/MCFPP.kt @@ -0,0 +1,55 @@ +package top.mcfpp + +import org.apache.logging.log4j.core.config.ConfigurationSource +import org.apache.logging.log4j.core.config.Configurator +import top.mcfpp.io.DatapackCreator +import top.mcfpp.model.field.GlobalField +import top.mcfpp.util.LogProcessor +import top.mcfpp.util.UwU +import java.io.FileInputStream + +/** + * 编译器的启动入口 + */ +fun main(args: Array) { + val source:ConfigurationSource + try { + source = ConfigurationSource(FileInputStream("log4j2.xml")) + Configurator.initialize(null,source) + }catch (e:Exception){ + println("Failed to load log4j2.xml") + } + if (args.isNotEmpty()) { + if(args.size > 1){ + if(args.contains("debug")){ + CompileSettings.isDebug = true + LogProcessor.warn("Compiling in debug mode.") + } + } + val start: Long = System.currentTimeMillis() + LogProcessor.info("Tips: " + UwU.tip) //生成tips + val path = args[0] + Project.readProject(path) //读取配置文件 + Project.readLib() //读取引用的库的索引 + Project.init() //初始化 + Project.indexType() //编制类型索引 + Project.indexFunction() //编制函数索引 + Project.compile() //编译 + Project.optimization() //优化 + Project.genIndex() //生成索引 + Project.ctx = null + if(Project.config.targetPath != "null"){ + try{ + DatapackCreator.createDatapack(Project.config.targetPath) //生成数据包 + }catch (e: Exception){ + LogProcessor.error("Cannot create datapack in path: ${Project.config.targetPath}") + } + } + LogProcessor.info("Finished in " + (System.currentTimeMillis() - start) + "ms") + GlobalField.printAll() + } +} + +object MCFPP { + val version = "0.1.0" +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/Project.kt b/src/main/kotlin/top/mcfpp/Project.kt new file mode 100644 index 00000000..7ffd4e5d --- /dev/null +++ b/src/main/kotlin/top/mcfpp/Project.kt @@ -0,0 +1,394 @@ +package top.mcfpp + +import com.alibaba.fastjson2.* +import org.antlr.v4.runtime.ParserRuleContext +import org.antlr.v4.runtime.tree.ParseTree +import org.apache.logging.log4j.* +import top.mcfpp.annotations.InsertCommand +import top.mcfpp.command.CommentType +import top.mcfpp.io.MCFPPFile +import top.mcfpp.io.lib.LibReader +import top.mcfpp.io.lib.LibWriter +import top.mcfpp.lang.MCFloat +import top.mcfpp.lang.UnresolvedVar +import top.mcfpp.lang.type.MCFPPBaseType +import top.mcfpp.model.* +import top.mcfpp.model.function.Function +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.field.NamespaceField +import top.mcfpp.lang.Var +import top.mcfpp.util.LogProcessor +import java.io.* +import java.nio.file.Path +import kotlin.io.path.absolutePathString +import kotlin.io.path.name + +/** + * 一个工程。工程文件包含了这个mcfpp工程编译需要的所有信息。编译器将会以这个文件为入口开始编译。 + * 同时,这个工程文件的名字也是此文件编译生成的数据包的命名空间。 + */ +object Project { + + private var logger: Logger = LogManager.getLogger("mcfpp") + + val config = ProjectConfig() + + var ctx: ParserRuleContext? = null + + /** + * 当前解析文件的语法树 + */ + var trees:MutableMap = mutableMapOf() + + /** + * 当前的命名空间 + */ + var currNamespace = config.defaultNamespace + + /** + * 工程中的总错误数量 + */ + private var errorCount = 0 + + /** + * 工程中的总警告数量 + */ + private var warningCount = 0 + + lateinit var mcfppTick : Function + + lateinit var mcfppLoad : Function + + lateinit var mcfppInit : Function + + /** + * 常量池 + */ + val constants : HashMap> = HashMap() + + /** + * 宏命令 + */ + val macroFunction : LinkedHashMap = LinkedHashMap() + + /** + * 初始化 + */ + fun init() { + //全局缓存初始化 + GlobalField.init() + //初始化mcfpp的tick和load函数 + //添加命名空间 + GlobalField.localNamespaces["mcfpp"] = Namespace("mcfpp") + mcfppTick = Function("tick","mcfpp", MCFPPBaseType.Void) + mcfppLoad = Function("load","mcfpp", MCFPPBaseType.Void) + mcfppInit = Function("init", "mcfpp", MCFPPBaseType.Void) + GlobalField.localNamespaces["mcfpp"]!!.field.addFunction(mcfppLoad,true) + GlobalField.localNamespaces["mcfpp"]!!.field.addFunction(mcfppTick,true) + GlobalField.localNamespaces["mcfpp"]!!.field.addFunction(mcfppInit, true) + GlobalField.functionTags["minecraft:tick"]!!.functions.add(mcfppTick) + GlobalField.functionTags["minecraft:load"]!!.functions.add(mcfppLoad) + GlobalField.functionTags["minecraft:load"]!!.functions.add(mcfppInit) + } + + /** + * 读取工程 + * @param path 工程的json文件的路径 + */ + fun readProject(path: String) { + //工程信息读取 + try { + //读取json + logger.debug("Reading project from file \"$path\"") + val reader = FileReader(path) + val qwq = File(path) + config.root = Path.of(path).parent + config.name = qwq.name.substring(0, qwq.name.lastIndexOf('.')) + val json = reader.readText() + //解析json + val jsonObject: JSONObject = JSONObject.parse(json) as JSONObject + //代码文件 + config.files = ArrayList() + val filesJson: JSONArray = jsonObject.getJSONArray("files") + for (o in filesJson.toArray()) { + var s = o as String + if (s.endsWith("*")) { + //通配符 + s = s.substring(0, s.length - 1) + } + val r: File = if (s.length > 2 && s[1] == ':') { + //绝对路径 + File(s) + } else { + //相对路径 + File(config.root.absolutePathString() + s) + } + logger.info("Finding file in \"" + r.absolutePath + "\"") + config.files = getFiles(r) + } + //版本 + config.version = jsonObject.getString("version") + if (config.version == null) { + config.version = "1.20" + } + //描述 + config.description = jsonObject.getString("description") + if (config.description == null) { + config.description = "A datapack compiled by MCFPP" + } + //默认命名空间 + config.defaultNamespace = if(jsonObject.getString("namespace") != null){ + jsonObject.getString("namespace") + }else{ + "default" + } + //是否包含标准库 + jsonObject["ignoreStdLib"]?.let { + CompileSettings.ignoreStdLib = it as Boolean + } + //调用库 + val includesJson: JSONArray = jsonObject.getJSONArray("includes")?: JSONArray() + for (i in 0 until includesJson.size) { + config.includes.add(includesJson.getString(i)) + } + //输出目录 + config.targetPath = jsonObject.getString("targetPath")?: "out/" + } catch (e: Exception) { + logger.error("Error while reading project from file \"$path\"") + errorCount++ + e.printStackTrace() + } + } + + /** + * 读取库文件,并将库写入缓存 + */ + fun readLib(){ + //默认的 + if(!CompileSettings.ignoreStdLib){ + config.includes.addAll(config.stdLib) + } + //写入缓存 + for (include in config.includes) { + val filePath = if(!include.endsWith("/.mclib")) "$include/.mclib" else include + val file = File(filePath) + if(file.exists()){ + LibReader.read(filePath) + }else{ + LogProcessor.error("Cannot find lib file at: ${file.absolutePath}") + } + } + //库读取完了,现在实例化所有类中的成员字段吧 + for(namespace in GlobalField.libNamespaces.values){ + namespace.field.forEachClass { c -> + run { + for (v in c.field.allVars){ + if(v is UnresolvedVar){ + c.field.putVar(c.identifier, v.resolve(c), true) + } + } + for (v in c.staticField.allVars){ + if(v is UnresolvedVar){ + c.staticField.putVar(c.identifier, v.resolve(c), true) + } + } + } + } + } + } + + /** + * 编制类型索引 + */ + fun indexType(){ + logger.debug("Generate Type Index...") + //解析文件 + for (file in config.files) { + //添加默认库的域 + if(!CompileSettings.ignoreStdLib){ + GlobalField.importedLibNamespaces["mcfpp.sys"] = GlobalField.libNamespaces["mcfpp.sys"] + } + try { + file.indexType() + } catch (e: IOException) { + logger.error("Error while generate type index in file \"$file\"") + errorCount++ + e.printStackTrace() + } + GlobalField.importedLibNamespaces.clear() + } + + } + + /** + * 编制函数索引 + */ + fun indexFunction() { + logger.debug("Generate Function Index...") + //解析文件 + for (file in config.files) { + try { + file.indexFunction() + } catch (e: IOException) { + logger.error("Error while generate function index in file \"$file\"") + errorCount++ + e.printStackTrace() + } + } + } + + /** + * 编译工程 + */ + fun compile() { + //工程文件编译 + //解析文件 + for (file in config.files) { + LogProcessor.debug("Compiling mcfpp code in \"$file\"") + //添加默认库域 + if(!CompileSettings.ignoreStdLib){ + GlobalField.importedLibNamespaces["mcfpp.sys"] = GlobalField.libNamespaces["mcfpp.sys"] + } + try { + file.compile() + } catch (e: IOException) { + logger.error("Error while compiling file \"$file\"") + errorCount++ + e.printStackTrace() + } + } + } + + /** + * 整理并优化工程 + */ + @InsertCommand + fun optimization() { + logger.debug("Optimizing...") + logger.debug("Adding scoreboards declare in mcfpp:load function") + //region load init command + //向load函数中添加记分板初始化命令 + Function.currFunction = GlobalField.localNamespaces["mcfpp"]!!.field.getFunction("load", ArrayList(), ArrayList())!! + for (scoreboard in GlobalField.scoreboards.values){ + Function.addCommand("scoreboard objectives add ${scoreboard.name} ${scoreboard.criterion}") + } + //向load函数中添加库初始化命令 + Function.addCommand("execute unless score math mcfpp_init matches 1 run function math:_init") + //向load中添加类初始化命令 + for (n in GlobalField.localNamespaces.values){ + n.field.forEachClass { c-> + run { + c.classPreStaticInit.invoke(ArrayList(), callerClassP = null) + } + } + } + //浮点数临时marker实体 + Function.addCommand("summon marker 0 0 0 {Tags:[\"mcfpp:float_marker\"],UUID:${MCFloat.tempFloatEntityUUIDNBT}}") + //endregion + //浮点数的 + //寻找入口函数 + var hasEntrance = false + for(field in GlobalField.localNamespaces.values){ + field.field.forEachFunction { f-> + run { + if (f.parent.size == 0 && f !is Native) { + //找到了入口函数 + hasEntrance = true + f.commands.add(0, "data modify storage mcfpp:system ${config.defaultNamespace}.stack_frame prepend value {}") + f.commands.add("data remove storage mcfpp:system ${config.defaultNamespace}.stack_frame[0]") + logger.debug("Find entrance function: {} {}", f.tags, f.identifier) + } + } + } + } + if (!hasEntrance) { + logger.warn("No valid entrance function in Project ${config.defaultNamespace}") + warningCount++ + } + logger.info("Complete compiling project " + config.root.name + " with [$errorCount] error and [$warningCount] warning") + } + + /** + * 生成库索引 + * 在和工程信息json文件的同一个目录下生成一个.mclib文件 + */ + fun genIndex() { + LibWriter.write(config.root.absolutePathString()) + } + + /** + * 获取文件列表 + * @param file 根目录 + * @return 这个根目录下包含的所有文件 + */ + private fun getFiles(file: File) : ArrayList { + val files = ArrayList() + if (!file.exists()) { + logger.warn("Path \"" + file.absolutePath + "\" doesn't exist. Ignoring.") + warningCount++ + return ArrayList() + } + val fs: Array = file.listFiles() ?: return ArrayList() + for (f in fs) { + if (f.isDirectory) //若是目录,则递归打印该目录下的文件 + files += getFiles(f) + if (f.isFile && f.name.substring(f.name.lastIndexOf(".") + 1) == "mcfpp") { + if (!files.contains(MCFPPFile(f))) { + files.add(MCFPPFile(f)) + } + } + } + return files + } +} + +data class ProjectConfig( + /** + * 工程对应的mc版本 + */ + var version: String? = null, + + /** + * 工程的名字 + */ + var defaultNamespace: String = "default", + + /** + * 数据包输出的文件夹 + */ + var targetPath : String = "out/", + + /** + * 标准库列表 + */ + val stdLib: List = listOf("mcfpp/sys/.mclib","mcfpp/math/.mclib","mcfpp/dynamic/.mclib"), + + /** + * 注释输出等级 + */ + var commentLevel : CommentType = CommentType.DEBUG, + + /** + * 工程的根目录 + */ + var root: Path = Path.of("."), + /** + * 工程包含的所有文件 + */ + var files: ArrayList = ArrayList(), + + /** + * 工程的名字 + */ + var name: String = "new_mcfpp_project", + + /** + * 数据包的描述。原始Json文本 TODO + */ + var description: String? = null, + + /** + * 工程包含的所有引用 + */ + var includes: ArrayList = ArrayList() +) \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/annotations/MCFPNativeProcessor.kt b/src/main/kotlin/top/mcfpp/annotations/MCFPNativeProcessor.kt new file mode 100644 index 00000000..6c2a91e4 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/annotations/MCFPNativeProcessor.kt @@ -0,0 +1,28 @@ +package top.mcfpp.annotations + +import javax.annotation.processing.AbstractProcessor +import javax.annotation.processing.RoundEnvironment +import javax.lang.model.element.ElementKind +import javax.lang.model.element.ExecutableElement +import javax.lang.model.element.TypeElement +import javax.tools.Diagnostic + +class MCFPNativeProcessor : AbstractProcessor() { + + override fun getSupportedAnnotationTypes(): MutableSet { + return mutableSetOf(MCFPPNative::class.java.name) + } + + override fun process(annotations: MutableSet?, roundEnv: RoundEnvironment?): Boolean { + roundEnv?.getElementsAnnotatedWith(MCFPPNative::class.java)?.forEach { element -> + if (element.kind == ElementKind.METHOD) { + val methodElement = element as ExecutableElement + val parameters = methodElement.parameters + if (parameters.size != 2 || parameters[0].asType().toString() != "Var[]" || parameters[1].asType().toString() != "CanSelectMember") { + processingEnv.messager.printMessage(Diagnostic.Kind.ERROR, "Method ${methodElement.simpleName} annotated with @MCFPNative must have parameters Var[] vars, CanSelectMember caller") + } + } + } + return true + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppErrorListener.kt b/src/main/kotlin/top/mcfpp/antlr/McfppErrorListener.kt new file mode 100644 index 00000000..f92f8261 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppErrorListener.kt @@ -0,0 +1,7 @@ +package top.mcfpp.antlr + +import org.antlr.v4.runtime.BaseErrorListener + +class McfppErrorListener : BaseErrorListener() { + +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppExprVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppExprVisitor.kt new file mode 100644 index 00000000..b962ec81 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppExprVisitor.kt @@ -0,0 +1,657 @@ +package top.mcfpp.antlr + +import net.querz.nbt.io.SNBTUtil +import net.querz.nbt.tag.StringTag +import top.mcfpp.Project +import top.mcfpp.annotations.InsertCommand +import top.mcfpp.lang.* +import top.mcfpp.lang.type.MCFPPBaseType +import top.mcfpp.lang.type.MCFPPGenericClassType +import top.mcfpp.lang.type.MCFPPType +import top.mcfpp.lang.value.MCFPPValue +import top.mcfpp.model.* +import top.mcfpp.model.function.Function +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.field.NamespaceField +import top.mcfpp.model.function.FunctionParam +import top.mcfpp.model.function.NoStackFunction +import top.mcfpp.model.function.UnknownFunction +import top.mcfpp.model.generic.Generic +import top.mcfpp.model.generic.GenericClass +import top.mcfpp.util.LogProcessor +import top.mcfpp.util.StringHelper +import top.mcfpp.util.Utils +import java.lang.IllegalArgumentException +import java.lang.StringBuilder +import java.util.* +import kotlin.collections.ArrayList +import kotlin.collections.HashMap +import kotlin.system.exitProcess + +/** + * 获取表达式结果用的visitor。解析并计算一个形如a+b*c的表达式。 + */ +class McfppExprVisitor(private var defaultGenericClassType : MCFPPGenericClassType? = null): mcfppParserBaseVisitor?>() { + + private val tempVarCommandCache = HashMap, String>() + + var processVarCache : ArrayList> = ArrayList() + fun clearCache(){ processVarCache.clear() } + + private var currSelector : CanSelectMember? = null + + + + /** + * 计算一个复杂表达式 + * @param ctx the parse tree + * @return 表达式的结果 + */ + @Override + override fun visitExpression(ctx: mcfppParser.ExpressionContext): Var<*>? { + Project.ctx = ctx + val l = Function.currFunction + val f = NoStackFunction("expression_${UUID.randomUUID()}",Function.currFunction) + Function.currFunction = f + return if(ctx.primary() != null){ + val q = visit(ctx.primary()) + Function.currFunction = l + l.commands.addAll(f.commands) + q + }else{ + val q = visit(ctx.conditionalOrExpression()) + Function.currFunction = l + if(q !is ReturnedMCBool){ + l.commands.addAll(f.commands) + }else{ + //注册函数 + if(!GlobalField.localNamespaces.containsKey(f.namespace)) + GlobalField.localNamespaces[f.namespace] = Namespace(f.namespace) + GlobalField.localNamespaces[f.namespace]!!.field.addFunction(f,false) + } + q + } + } + + /*TODO 三目表达式。可能会实现,但是泠雪是懒狐,不想做。 + *@Override + *public Var visitConditionalExpression(mcfppParser.ConditionalExpressionContext ctx){ + * if(ctx.expression().size() == 0){ + * return visit(ctx.conditionalOrExpression()); + * }else { + * return null; + * } + *} + */ + + /** + * 计算一个或表达式。例如 a || b。 + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitConditionalOrExpression(ctx: mcfppParser.ConditionalOrExpressionContext): Var<*>? { + Project.ctx = ctx + if(ctx.conditionalAndExpression().size != 1){ + val list = ArrayList() + val l = Function.currFunction + var isConcrete = true + var result = false + for (i in 0 until ctx.conditionalAndExpression().size) { + val temp = NoStackFunction("bool_${UUID.randomUUID()}",Function.currFunction) + //注册函数 + if(!GlobalField.localNamespaces.containsKey(temp.namespace)) + GlobalField.localNamespaces[temp.namespace] = Namespace(temp.namespace) + GlobalField.localNamespaces[temp.namespace]!!.field.addFunction(temp,false) + Function.currFunction = temp + val b: Var<*>? = visit(ctx.conditionalAndExpression(i)) + Function.currFunction = l + if (b !is MCBool) { + LogProcessor.error("The operator \"&&\" cannot be used with ${b!!.type}") + throw IllegalArgumentException("") + } + if(b is MCFPPValue<*> && isConcrete){ + result = result || b.value == true + }else{ + isConcrete = false + } + } + if(isConcrete){ + return MCBoolConcrete(result) + } + for (v in list){ + Function.addCommand("execute if function ${v.parentFunction.namespaceID} run return 1") + } + Function.addCommand("return 0") + return ReturnedMCBool(Function.currFunction) + }else{ + return visit(ctx.conditionalAndExpression(0)) + } + } + + /** + * 计算一个与表达式。例如a && b + * @param ctx the parse tree + * @return 表达式的值 + */ + //和 + @Override + override fun visitConditionalAndExpression(ctx: mcfppParser.ConditionalAndExpressionContext): Var<*>? { + Project.ctx = ctx + if(ctx.equalityExpression().size != 1){ + val list = ArrayList() + val l = Function.currFunction + var isConcrete = true + var result = true + for (i in 0 until ctx.equalityExpression().size) { + val temp = NoStackFunction("bool_${UUID.randomUUID()}",Function.currFunction) + //注册函数 + if(!GlobalField.localNamespaces.containsKey(temp.namespace)) + GlobalField.localNamespaces[temp.namespace] = Namespace(temp.namespace) + GlobalField.localNamespaces[temp.namespace]!!.field.addFunction(temp,false) + Function.currFunction = temp + val b: Var<*>? = visit(ctx.equalityExpression(i)) + Function.currFunction = l + if (b !is MCBool) { + LogProcessor.error("The operator \"&&\" cannot be used with ${b!!.type}") + throw IllegalArgumentException("") + } + if(b is MCFPPValue<*> && isConcrete){ + result = result && b.value == true + }else{ + isConcrete = false + } + } + if(isConcrete){ + return MCBoolConcrete(result) + } + val sb = StringBuilder("execute ") + for (v in list){ + sb.append("if function ${v.parentFunction.namespaceID} ") + } + sb.append("run return 1") + Function.addCommand(sb.toString()) + Function.addCommand("return 0") + return ReturnedMCBool(Function.currFunction) + }else{ + return visit(ctx.equalityExpression(0)) + } + } + + /** + * 计算一个等于或不等于表达式,例如a == b和a != b + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitEqualityExpression(ctx: mcfppParser.EqualityExpressionContext): Var<*>? { + Project.ctx = ctx + var re: Var<*>? = visit(ctx.relationalExpression(0)) + if (ctx.relationalExpression().size != 1) { + val b: Var<*>? = visit(ctx.relationalExpression(1)) + if(!re!!.isTemp){ + re = re.getTempVar() + } + if (ctx.op.text.equals("==")) { + re = if (re is MCInt && b is MCInt) { + re.isEqual(b) + } else if (re is MCBool && b is MCBool) { + re.equalCommand(b) + } else if (re is MCFloat && b is MCFloat){ + re.isEqual(b) + } else{ + LogProcessor.error("The operator \"${ctx.op.text}\" cannot be used between ${re.type} and ${b!!.type}") + throw IllegalArgumentException("") + } + } else { + re = if (re is MCInt && b is MCInt) { + re.isNotEqual(b) + } else if (re is MCBool && b is MCBool) { + re.notEqualCommand(b) + } else if (re is MCFloat && b is MCFloat){ + re.isNotEqual(b) + }else{ + LogProcessor.error("The operator \"${ctx.op.text}\" cannot be used between ${re.type} and ${b!!.type}") + throw IllegalArgumentException("") + } + } + } + return re + } + + /** + * 计算一个比较表达式,例如a > b + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitRelationalExpression(ctx: mcfppParser.RelationalExpressionContext): Var<*>? { + Project.ctx = ctx + var re: Var<*>? = visit(ctx.additiveExpression(0)) + if (ctx.additiveExpression().size != 1) { + val b: Var<*>? = visit(ctx.additiveExpression(1)) + if (re is MCInt && b is MCInt) { + when (ctx.relationalOp().text) { + ">" -> re = re.isBigger(b) + ">=" -> re = re.isGreaterOrEqual(b) + "<" -> re = re.isSmaller(b) + "<=" -> re = re.isSmallerOrEqual(b) + } + } else if(re is MCFloat && b is MCFloat){ + when (ctx.relationalOp().text) { + ">" -> re = re.isBigger(b) + ">=" -> re = re.isGreaterOrEqual(b) + "<" -> re = re.isSmaller(b) + "<=" -> re = re.isSmallerOrEqual(b) + } + }else { + LogProcessor.error("The operator \"${ctx.relationalOp()}\" cannot be used between ${re!!.type} and ${b!!.type}") + throw IllegalArgumentException("") + } + } + return re + } + + private var visitAdditiveExpressionRe : Var<*>? = null + /** + * 计算一个加减法表达式,例如a + b + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitAdditiveExpression(ctx: mcfppParser.AdditiveExpressionContext): Var<*>? { + Project.ctx = ctx + visitAdditiveExpressionRe = visit(ctx.multiplicativeExpression(0)) + processVarCache.add(visitAdditiveExpressionRe!!) + for (i in 1 until ctx.multiplicativeExpression().size) { + var b: Var<*>? = visit(ctx.multiplicativeExpression(i)) + if(b is MCFloat) b = b.toTempEntity() + if(visitAdditiveExpressionRe!! != MCFloat.ssObj){ + visitAdditiveExpressionRe = visitAdditiveExpressionRe!!.getTempVar() + } + visitAdditiveExpressionRe = if (Objects.equals(ctx.op.text, "+")) { + visitAdditiveExpressionRe!!.plus(b!!) + } else if (Objects.equals(ctx.op.text, "-")) { + visitAdditiveExpressionRe!!.minus(b!!) + } else { + null + } + if(visitAdditiveExpressionRe == null){ + LogProcessor.error("The operator \"${ctx.op.text}\" cannot be used between ${visitAdditiveExpressionRe!!.type} and ${b!!.type}.") + Utils.stopCompile(IllegalArgumentException("")) + exitProcess(1) + } + processVarCache[processVarCache.size - 1] = visitAdditiveExpressionRe!! + } + processVarCache.remove(visitAdditiveExpressionRe!!) + return visitAdditiveExpressionRe + } + + private var visitMultiplicativeExpressionRe : Var<*>? = null + + /** + * 计算一个乘除法表达式,例如a * b + * @param ctx the parse tree + * @return 表达式的值 + */ + //乘法 + @Override + override fun visitMultiplicativeExpression(ctx: mcfppParser.MultiplicativeExpressionContext): Var<*>? { + Project.ctx = ctx + visitMultiplicativeExpressionRe = visit(ctx.unaryExpression(0)) + processVarCache.add(visitMultiplicativeExpressionRe!!) + for (i in 1 until ctx.unaryExpression().size) { + var b: Var<*>? = visit(ctx.unaryExpression(i)) + if(b is MCFloat) b = b.toTempEntity() + if(visitMultiplicativeExpressionRe != MCFloat.ssObj){ + visitMultiplicativeExpressionRe = visitMultiplicativeExpressionRe!!.getTempVar() + } + visitMultiplicativeExpressionRe = when(ctx.op.text){ + "*" -> { + visitAdditiveExpressionRe!!.multiple(b!!) + } + "/" -> { + visitAdditiveExpressionRe!!.divide(b!!) + } + "%" -> { + visitAdditiveExpressionRe!!.modular(b!!) + } + else -> null + } + if(visitMultiplicativeExpressionRe == null){ + LogProcessor.error("The operator \"${ctx.op.text}\" cannot be used between ${visitMultiplicativeExpressionRe!!.type} and ${b!!.type}.") + Utils.stopCompile(IllegalArgumentException("")) + exitProcess(1) + } + processVarCache[processVarCache.size - 1] = visitMultiplicativeExpressionRe!! + } + processVarCache.remove(visitMultiplicativeExpressionRe!!) + return visitMultiplicativeExpressionRe + } + + /** + * 计算一个单目表达式。比如!a 或者 (int)a + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitUnaryExpression(ctx: mcfppParser.UnaryExpressionContext): Var<*>? { + Project.ctx = ctx + return if (ctx.rightVarExpression() != null) { + visit(ctx.rightVarExpression()) + } else if (ctx.unaryExpression() != null) { + var a: Var<*>? = visit(ctx.unaryExpression()) + if (a is MCBool) { + if(!a.isTemp){ + a = a.getTempVar() + } + a.negation() + } else { + LogProcessor.error("The operator \"!\" cannot be used with ${a!!.type}") + Utils.stopCompile(IllegalArgumentException("")) + exitProcess(1) + } + } else { + //类型强制转换 + visit(ctx.castExpression()) + } + } + + + /** + * 计算一个强制转换表达式。 + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitCastExpression(ctx: mcfppParser.CastExpressionContext): Var<*> { + Project.ctx = ctx + val a: Var<*>? = visit(ctx.unaryExpression()) + return a!!.cast(MCFPPType.parseFromIdentifier(ctx.type().text, Function.currFunction.field)) + } + + /** + * 对获取到的变量进行包装处理 + * + * @param ctx + * @return + */ + @Override + override fun visitRightVarExpression(ctx: mcfppParser.RightVarExpressionContext?): Var<*> { + return visit(ctx!!.basicExpression())!! + //return visit(ctx!!.basicExpression())!!.getTempVar(tempVarCommandCache) + } + + /** + * 计算一个基本的表达式。可能是一个变量,也可能是一个数值 + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitBasicExpression(ctx: mcfppParser.BasicExpressionContext): Var<*>? { + Project.ctx = ctx + return if (ctx.primary() != null) { + visit(ctx.primary()) + } else { + visit(ctx.varWithSelector()) + } + } + + /** + * 从类中选择一个成员。返回的成员包含了它所在的对象的信息 + * + * @param ctx + * @return + */ + @Override + override fun visitVarWithSelector(ctx: mcfppParser.VarWithSelectorContext): Var<*>? { + Project.ctx = ctx + currSelector = if(ctx.primary() != null){ + //从变量中选择(非静态成员) + visit(ctx.primary()) + }else{ + //从类型中选择(静态成员) + //TODO 此处的词法需要更改,className和Identifier有冲突 + if(ctx.type().className() != null){ + //ClassName + val clsstr = ctx.type().text.split(":") + val qwq: Class? = if(clsstr.size == 2) { + GlobalField.getClass(clsstr[0], clsstr[1]) + }else{ + GlobalField.getClass(null, clsstr[0]) + } + if (qwq == null) { + LogProcessor.error("Undefined class:" + ctx.type().className().text) + return UnknownVar("${ctx.type().className().text}_type_" + UUID.randomUUID()) + } + qwq.getType() + }else{ + CompoundDataType( + //基本类型 + when(ctx.type().text){ + "int" -> MCInt.data + else -> TODO() + } + ) + } + + } + for (selector in ctx.selector()){ + visit(selector) + } + return currSelector as? Var<*> + } + + @Override + override fun visitSelector(ctx: mcfppParser.SelectorContext?): Var<*>? { + //进入visitVar,currSelector作为成员选择的上下文 + currSelector = visit(ctx!!.`var`())!!.getTempVar() + return null + } + + /** + * 一个初级表达式,可能是一个变量,也可能是一个数值 + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitPrimary(ctx: mcfppParser.PrimaryContext): Var<*>? { + Project.ctx = ctx + if (ctx.`var`() != null) { + //变量 + return visit(ctx.`var`()) + } else if (ctx.value() != null) { + return visit(ctx.value()) + } else { + //this或者super + val re: Var<*>? = Function.field.getVar(ctx.text) + if (re == null) { + LogProcessor.error("${ctx.text} can only be used in member functions.") + } + return re + } + } + + /** + * 变量 + * @param ctx the parse tree + * @return 变量 + */ + @Override + @InsertCommand + override fun visitVar(ctx: mcfppParser.VarContext): Var<*>? { + Project.ctx = ctx + if (ctx.Identifier() != null && ctx.arguments() == null) { + //变量 + //没有数组选取 + val qwq: String = ctx.Identifier().text + var re = if(currSelector == null){ + val re: Var<*>? = Function.currFunction.field.getVar(qwq) + if (re == null) { + LogProcessor.error("Undefined variable:$qwq") + throw Exception() + } + re + }else{ + //获取成员 + val re = currSelector!!.getMemberVar(qwq, currSelector!!.getAccess(Function.currFunction)) + if (re.first == null) { + LogProcessor.error("Undefined field: $qwq") + } + if (!re.second){ + LogProcessor.error("Cannot access member $qwq") + } + re.first + } + // Identifier identifierSuffix* + if (ctx.identifierSuffix() == null || ctx.identifierSuffix().size == 0) { + return re + } else { + if(re is Indexable<*>){ + for (value in ctx.identifierSuffix()) { + val index = visit(value.conditionalExpression())!! + re = (re as Indexable<*>).getByIndex(index) + } + }else{ + throw IllegalArgumentException("Cannot index ${re!!.type}") + } + return re + } + } else if (ctx.expression() != null) { + // '(' expression ')' + return McfppExprVisitor().visit(ctx.expression()) + } else { + //是函数调用,将已经计算好的中间量存储到栈中 + for (v in processVarCache){ + v.storeToStack() + } + //函数的调用 + Function.addCommand("#" + ctx.text) + //参数获取 + val normalArgs: ArrayList> = ArrayList() + val readOnlyArgs: ArrayList> = ArrayList() + val exprVisitor = McfppExprVisitor() + for (expr in ctx.arguments().readOnlyArgs()?.expressionList()?.expression()?: emptyList()) { + val arg = exprVisitor.visit(expr)!! + readOnlyArgs.add(arg) + } + for (expr in ctx.arguments().normalArgs().expressionList()?.expression()?: emptyList()) { + val arg = exprVisitor.visit(expr)!! + normalArgs.add(arg) + } + //获取函数 + val p = StringHelper.splitNamespaceID(ctx.namespaceID().text) + val func = if(currSelector == null){ + GlobalField.getFunction(p.first, p.second, FunctionParam.getArgTypeNames(readOnlyArgs), FunctionParam.getArgTypeNames(normalArgs)) + }else{ + if(p.first != null){ + LogProcessor.warn("Invalid namespace usage ${p.first} in function call ") + } + McfppFuncManager().getFunction(currSelector!!,p.second, + FunctionParam.getArgTypes(readOnlyArgs), + FunctionParam.getArgTypes(normalArgs)) + } + //调用函数 + return if (func is UnknownFunction) { + var cls: Class? = if(ctx.arguments().readOnlyArgs() != null){ + GlobalField.getClass(p.first, p.second ,readOnlyArgs.map { it.type }) + }else{ + GlobalField.getClass(p.first, p.second) + } + //可能是构造函数 + if (cls == null) { + LogProcessor.error("Function " + ctx.text + " not defined") + Function.addCommand("[Failed to Compile]${ctx.text}") + func.invoke(normalArgs,currSelector) + return func.returnVar + } + if(cls is GenericClass){ + if(defaultGenericClassType != null){ + //比对实例化参数 + //参数不一致 + if(defaultGenericClassType!!.genericVar.size != readOnlyArgs.size){ + LogProcessor.error("Generic class ${cls.identifier} requires ${cls.readOnlyParams.size} type arguments, but ${readOnlyArgs.size} were provided") + return UnknownVar("${cls.identifier}_type_" + UUID.randomUUID()) + } + //参数缺省 + if(readOnlyArgs.isEmpty()){ + readOnlyArgs.addAll(defaultGenericClassType!!.genericVar) + } + } + //实例化泛型函数 + cls = cls.compile(readOnlyArgs) + } + //获取对象 + val ptr = cls.newInstance() + //调用构造函数 + val constructor = cls.getConstructor(FunctionParam.getArgTypeNames(normalArgs)) + if (constructor == null) { + LogProcessor.error("No constructor like: " + FunctionParam.getArgTypeNames(normalArgs) + " defined in class " + ctx.namespaceID().text) + Function.addCommand("[Failed to compile]${ctx.text}") + }else{ + constructor.invoke(normalArgs, callerClassP = ptr) + } + return ptr + }else{ + if(func is Generic<*>){ + func.invoke(readOnlyArgs, normalArgs, currSelector) + }else{ + func.invoke(normalArgs,currSelector) + } + for (v in processVarCache){ + v.getFromStack() + } + //函数树 + Function.currFunction.child.add(func) + func.parent.add(Function.currFunction) + func.returnVar + } + } + } + + override fun visitValue(ctx: mcfppParser.ValueContext): Var<*>? { + //常量 + if (ctx.intValue() != null) { + return MCIntConcrete(Integer.parseInt(ctx.intValue().text)) + } else if (ctx.LineString() != null) { + val r: String = ctx.LineString().text + return MCStringConcrete(StringTag(r.substring(1, r.length - 1))) + } else if (ctx.multiLineStringLiteral()!=null){ + val stringArray = mutableListOf() + var isConcrete = true + for(stringContext in ctx.multiLineStringLiteral().multiLineStringContent()){ + var r:String + if(stringContext.MultiLineStrText()!=null) r= stringContext.MultiLineStrText().text + else if(stringContext.MultiLineStringQuote()!=null) r= stringContext.MultiLineStringQuote().text + else { + val expressionContext = stringContext.multiLineStringExpression().expression() + //TODO: 这边只是简单写了一下有解析值的情况 + val res = visit(expressionContext) //没有解析值的话,应该变成jtext + if(res!=null && res !is MCFPPValue<*>){ isConcrete = false } //这个条件就是说,整个模版中出现没有解析值的情况了 + if(res is MCIntConcrete){ + r = res.value.toString() + } + else{ + r=res.toString() + } + } + stringArray.add(r); + } + val tailQuote = ctx.multiLineStringLiteral().TRIPLE_QUOTE_CLOSE().text + if(tailQuote.length>3) { + stringArray.add(tailQuote.substring(3,tailQuote.length)) + } + return MCStringConcrete(StringTag(stringArray.joinToString("")) ) //没有解析值就变不了MCString了 + } else if (ctx.floatValue() != null){ + return MCFloatConcrete(ctx.floatValue()!!.text.toFloat()) + } else if (ctx.boolValue() != null){ + return MCBoolConcrete(ctx.boolValue()!!.text.toBoolean()) + } else if (ctx.nbtValue() != null){ + return NBTBasedDataConcrete(SNBTUtil.fromSNBT(ctx.nbtValue().text)) + } else if (ctx.type() != null){ + return MCFPPTypeVar(MCFPPType.parseFromIdentifier(ctx.type().text, Function.currFunction.field)) + } + return null + } + +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppFieldVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppFieldVisitor.kt new file mode 100644 index 00000000..94969f68 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppFieldVisitor.kt @@ -0,0 +1,861 @@ +package top.mcfpp.antlr + +import top.mcfpp.Project +import top.mcfpp.annotations.InsertCommand +import top.mcfpp.antlr.mcfppParser.TemplateDeclarationContext +import top.mcfpp.compiletime.CompileTimeFunction +import top.mcfpp.exception.* +import top.mcfpp.exception.IllegalFormatException +import top.mcfpp.io.MCFPPFile +import top.mcfpp.lang.* +import top.mcfpp.lang.type.MCFPPBaseType +import top.mcfpp.lang.type.MCFPPType +import top.mcfpp.lang.type.UnresolvedType +import top.mcfpp.model.* +import top.mcfpp.model.Class +import top.mcfpp.model.Member.AccessModifier +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.field.IFieldWithType +import top.mcfpp.model.function.* +import top.mcfpp.model.function.Function +import top.mcfpp.model.generic.GenericClass +import top.mcfpp.model.generic.GenericExtensionFunction +import top.mcfpp.model.generic.GenericFunction +import top.mcfpp.util.LazyWrapper +import top.mcfpp.util.LogProcessor +import java.util.* +import kotlin.collections.ArrayList + +/** + * 在编译工程之前,应当首先将所有文件中的资源全部遍历一次并写入缓存。 + * TODO 存在优化空间,因为部分代码和McfppTypeVisitor有高度重合和相关性 + */ +open class McfppFieldVisitor : mcfppParserBaseVisitor() { + + protected var isStatic = false + + protected lateinit var typeScope : IFieldWithType + + /** + * 遍历整个文件。一个文件包含了命名空间的声明,函数的声明,类的声明以及全局变量的声明。全局变量是可以跨文件调用的。 + * @param ctx the parse tree + * @return null + */ + override fun visitCompilationUnit(ctx: mcfppParser.CompilationUnitContext): Any? { + Project.ctx = ctx + //命名空间 + Project.currNamespace = ctx.namespaceDeclaration()?.let{ + //获取命名空间 + var namespaceStr = ctx.namespaceDeclaration().Identifier()[0].text + if(ctx.namespaceDeclaration().Identifier().size > 1){ + ctx.namespaceDeclaration().Identifier().forEach{e -> + run { + namespaceStr += ".${e.text}" + } + } + } + namespaceStr + }?: Project.config.defaultNamespace + typeScope = GlobalField.localNamespaces[Project.currNamespace]!!.field + //文件结构,类和函数 + for (t in ctx.typeDeclaration()) { + visit(t) + } + return null + } + + /** + * 类或函数声明 + * @param ctx the parse tree + * @return null + */ + + override fun visitDeclarations(ctx: mcfppParser.DeclarationsContext): Any? { + Project.ctx = ctx + if (ctx.globalDeclaration() != null) { + return null + } + super.visitDeclarations(ctx) + return null + } + +//region interface + + override fun visitInterfaceDeclaration(ctx: mcfppParser.InterfaceDeclarationContext): Any? { + Project.ctx = ctx + //注册类 + val id = ctx.classWithoutNamespace().text + val namespace = GlobalField.localNamespaces[Project.currNamespace]!! + + if (namespace.field.hasInterface(id)) { + //重复声明 + Interface.currInterface = namespace.field.getInterface(id) + } else { + throw UndefinedException("Interface Should have been defined: $id") + } + typeScope = Interface.currInterface!!.field + //接口成员 + for (m in ctx.interfaceBody().interfaceFunctionDeclaration()){ + visit(m) + } + typeScope = MCFPPFile.currFile!!.field + return null + } + + + override fun visitInterfaceFunctionDeclaration(ctx: mcfppParser.InterfaceFunctionDeclarationContext): Any? { + Project.ctx = ctx + //创建函数对象 + val f = Function( + ctx.Identifier().text, + Interface.currInterface!!, + MCFPPType.parseFromIdentifier(if(ctx.functionReturnType() == null) "void" else ctx.functionReturnType().text, typeScope) + ) + //解析参数 + f.addParamsFromContext(ctx.functionParams()) + //注册函数 + if (Interface.currInterface!!.field.hasFunction(f)) { + LogProcessor.error("Already defined function:" + ctx.Identifier().text + "in class " + Class.currClass!!.identifier) + Function.currFunction = Function.nullFunction + } + return null + } +//endregion + +//region native class + /** + * TODO native类的声明 + * @param ctx the parse tree + * @return null + */ + override fun visitNativeClassDeclaration(ctx: mcfppParser.NativeClassDeclarationContext): Any? { + //NativeClassVisitor().visit(ctx) + return null + } +//endregion + +//region class + /** + * 类的声明 + * @param ctx the parse tree + * @return null + */ + + override fun visitClassDeclaration(ctx: mcfppParser.ClassDeclarationContext): Any? { + Project.ctx = ctx + //注册类 + val id = ctx.classWithoutNamespace().text + val namespace = GlobalField.localNamespaces[Project.currNamespace]!! + if(ctx.readOnlyParams() != null){ + return null + } + val clazz = if (namespace.field.hasClass(id)) { + namespace.field.getClass(id) + } else { + throw UndefinedException("Class Should have been defined: $id") + } + Class.currClass = clazz + typeScope = Class.currClass!!.field + //解析类中的成员 + //先静态 + isStatic = true + //先解析函数 + for (c in ctx.classBody().staticClassMemberDeclaration()) { + c!! + if (c.classMember().classFunctionDeclaration() != null || c.classMember().abstractClassFunctionDeclaration() != null) { + visit(c) + } + } + //再解析变量 + for (c in ctx.classBody().staticClassMemberDeclaration()) { + if (c!!.classMember().classFieldDeclaration() != null) { + visit(c) + } + } + //后成员 + isStatic = false + //先解析函数和构造函数 + for (c in ctx.classBody().classMemberDeclaration()) { + c!! + if (c.classMember() != null && (c.classMember().classFunctionDeclaration() != null || c.classMember().abstractClassFunctionDeclaration() != null)) { + visit(c) + } + } + //再解析变量 + for (c in ctx.classBody().classMemberDeclaration()) { + if (c!!.classMember() != null && c.classMember().classFieldDeclaration() != null) { + visit(c) + } + } + //如果没有构造函数,自动添加默认的空构造函数 + if (Class.currClass!!.constructors.size == 0) { + Class.currClass!!.addConstructor(Constructor(Class.currClass!!)) + } + //是否为抽象类 + if(!Class.currClass!!.isAbstract){ + var il : Function? = null + Class.currClass!!.field.forEachFunction { f -> + run { + if(f.isAbstract){ + il = f + return@run + } + } + } + if(il != null){ + LogProcessor.error("Class ${Class.currClass} must either be declared abstract or implement abstract method ${il!!.nameWithNamespace}") + } + } + Class.currClass = null + typeScope = MCFPPFile.currFile!!.field + return null + } + + + override fun visitStaticClassMemberDeclaration(ctx: mcfppParser.StaticClassMemberDeclarationContext): Any? { + Project.ctx = ctx + val m = visit(ctx.classMember()) as Member + //访问修饰符 + if (ctx.accessModifier() != null) { + m.accessModifier = AccessModifier.valueOf(ctx.accessModifier().text.uppercase(Locale.getDefault())) + } + m.isStatic = true + Class.currClass!!.addMember(m) + if(m is Function){ + m.field.removeVar("this") + } + return null + } + + /** + * 类成员的声明。由于函数声明可以后置,因此需要先查明函数声明情况再进行变量的注册以及初始化。 + *
+     * `classMemberDeclaration
+     * :   accessModifier? (STATIC)? classMember
+     * ;
+    `
* + * @param ctx the parse tree + * @return null + */ + + override fun visitClassMemberDeclaration(ctx: mcfppParser.ClassMemberDeclarationContext): Any? { + Project.ctx = ctx + val m = visit(ctx.classMember()) + if(m is Member){ + //访问修饰符 + if (ctx.accessModifier() != null) { + m.accessModifier = AccessModifier.valueOf(ctx.accessModifier().text.uppercase(Locale.getDefault())) + } + if (m !is Constructor) { + Class.currClass!!.addMember(m) + } + }else if(m is ArrayList<*>){ + //变量列表 + for (c in m){ + c as Member + //访问修饰符 + if (ctx.accessModifier() != null) { + c.accessModifier = AccessModifier.valueOf(ctx.accessModifier().text.uppercase(Locale.getDefault())) + } + if (c !is Constructor) { + Class.currClass!!.addMember(c) + } + } + } + return null + } + + override fun visitClassMember(ctx: mcfppParser.ClassMemberContext): Any? { + Project.ctx = ctx + return if (ctx.nativeClassFunctionDeclaration() != null) { + visit(ctx.nativeClassFunctionDeclaration()) + } else if (ctx.classFunctionDeclaration() != null) { + visit(ctx.classFunctionDeclaration()) + } else if (ctx.classFieldDeclaration() != null) { + visit(ctx.classFieldDeclaration()) + } else if (ctx.constructorDeclaration() != null) { + visit(ctx.constructorDeclaration()) + }else{ + return null + } + } + + /** + * 类方法的声明 + * @param ctx the parse tree + * @return 这个类方法的对象 + */ + + override fun visitClassFunctionDeclaration(ctx: mcfppParser.ClassFunctionDeclarationContext): Any { + Project.ctx = ctx + val type = MCFPPType.parseFromIdentifier(if(ctx.functionReturnType() == null) "void" else ctx.functionReturnType().text, typeScope) + //创建函数对象 + val f = if(ctx.functionParams().readOnlyParams() != null && ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0){ + GenericFunction( + ctx.Identifier().text, + Class.currClass!!, + ctx.parent is mcfppParser.StaticClassMemberDeclarationContext, + type, + ctx.functionBody() + ) + }else{ + Function( + ctx.Identifier().text, + Class.currClass!!, + ctx.parent is mcfppParser.StaticClassMemberDeclarationContext, + type + ) + } + if(!isStatic){ + val thisObj = Var.build("this", MCFPPType.parseFromIdentifier(Class.currClass!!.identifier, typeScope), f) + f.field.putVar("this",thisObj) + } + //解析参数 + f.addParamsFromContext(ctx.functionParams()) + //注册函数 + if (Class.currClass!!.field.hasFunction(f) || Class.currClass!!.staticField.hasFunction(f)) { + if(ctx.OVERRIDE() != null){ + if(isStatic){ + LogProcessor.error("Cannot override static method ${ctx.Identifier()}") + throw Exception() + } + }else{ + LogProcessor.error("Already defined function:" + ctx.Identifier().text + "in class " + Class.currClass!!.identifier) + Function.currFunction = Function.nullFunction + } + } + return f + } + + + override fun visitAbstractClassFunctionDeclaration(ctx: mcfppParser.AbstractClassFunctionDeclarationContext): Any { + Project.ctx = ctx + val type = MCFPPType.parseFromIdentifier(ctx.functionReturnType().text, typeScope) + //抽象函数没有函数体,不能作为GenericFunction + //创建函数对象 + val f = Function( + ctx.Identifier().text, + Class.currClass!!, + ctx.parent is mcfppParser.StaticClassMemberDeclarationContext, + type + ) + f.isAbstract = true + if(f.isStatic){ + LogProcessor.error("Static Function cannot be abstract: ${ctx.Identifier().text} in class ${Class.currClass!!.identifier}" ) + throw Exception() + } + //解析参数 + f.addParamsFromContext(ctx.functionParams()) + //注册函数 + if (Class.currClass!!.field.hasFunction(f)) { + LogProcessor.error("Already defined function:" + ctx.Identifier().text + "in class " + Class.currClass!!.identifier) + Function.currFunction = Function.nullFunction + } + return f + } + + override fun visitNativeClassFunctionDeclaration(ctx: mcfppParser.NativeClassFunctionDeclarationContext): Any? { + Project.ctx = ctx + val nf: NativeFunction = try { + //根据JavaRefer找到类 + val refer = ctx.javaRefer().text + val clsName = refer.substring(0,refer.lastIndexOf('.')) + val clazz = java.lang.Class.forName(clsName).getConstructor().newInstance() + if(clazz !is MNIMethodContainer){ + LogProcessor.error("Class $clsName should extends MNIMethodContainer") + throw IllegalArgumentException("Class $clsName should extends MNIMethodContainer") + } + NativeFunction(ctx.Identifier().text, clazz, MCFPPType.parseFromIdentifier(ctx.functionReturnType().text, typeScope), Project.currNamespace) + } catch (e: IllegalFormatException) { + LogProcessor.error("Illegal Java Method Name: " + e.message) + return null + } catch (e: ClassNotFoundException) { + LogProcessor.error("Cannot find java class: " + e.message) + return null + } catch (e: NoSuchMethodException) { + LogProcessor.error("MNIMethodContainer should have a non-parameter constructor: " + e.message) + return null + } catch (e: SecurityException){ + LogProcessor.error("Cannot access to the constructor: " + e.message) + return null + } + nf.addParamsFromContext(ctx.functionParams()) + //是类成员 + nf.ownerType = Function.Companion.OwnerType.CLASS + return nf + } + + /** + * 构造函数的声明 + * @param ctx the parse tree + * @return 这个构造函数的对象 + */ + override fun visitConstructorDeclaration(ctx: mcfppParser.ConstructorDeclarationContext): Any { + Project.ctx = ctx + //类构造函数 + //创建构造函数对象,注册函数 + val f = Constructor(Class.currClass!!) + f.addParamsFromContext(ctx.normalParams()) + if(!Class.currClass!!.addConstructor(f)){ + LogProcessor.error("Already defined constructor: " + ctx.className().text + "(" + ctx.normalParams().text + ")") + } + return f + } + + /** + * 类字段的声明 + * @param ctx the parse tree + * @return null + */ + @InsertCommand + override fun visitClassFieldDeclaration(ctx: mcfppParser.ClassFieldDeclarationContext): Any { + Project.ctx = ctx + //只有类字段构建 + val reList = ArrayList() + val c = ctx.fieldDeclarationExpression() + //字段的解析在Analyse阶段结束后,Compile阶段开始的时候进行 + val type = MCFPPType.parseFromIdentifier(ctx.type().text, typeScope) + val `var` = Var.build(c.Identifier().text, type, Class.currClass!!) + //是否是静态的 + if(isStatic){ + `var`.isStatic = true + `var`.parent = Class.currClass!!.getType() + }else{ + `var`.parent = ClassPointer(Class.currClass!!,"temp") + } + if (Class.currClass!!.field.containVar(c.Identifier().text) + || Class.currClass!!.staticField.containVar(c.Identifier().text) + ) { + LogProcessor.error("Duplicate defined variable name:" + c.Identifier().text) + return reList + } + //变量的初始化 + if (c.expression() != null) { + Function.currFunction = if(isStatic){ + `var`.isStatic = true + Class.currClass!!.classPreStaticInit + }else{ + Class.currClass!!.classPreInit + } + //是类的成员 + Function.addCommand("#" + ctx.text) + val init: Var<*> = McfppExprVisitor().visit(c.expression())!! + try { + `var`.assign(init) + } catch (e: VariableConverseException) { + LogProcessor.error("Cannot convert " + init.javaClass + " to " + `var`.javaClass) + Function.currFunction = Function.nullFunction + throw VariableConverseException() + } + Function.currFunction = Function.nullFunction + `var`.hasAssigned = true + } + reList.add(`var`) + return reList + } + +//endregion + +//region function + /** + * 函数的声明 + * @param ctx the parse tree + * @return null + */ + + override fun visitFunctionDeclaration(ctx: mcfppParser.FunctionDeclarationContext): Any? { + Project.ctx = ctx + //创建函数对象 + val identifier : String = ctx.Identifier().text + val type = MCFPPType.parseFromIdentifier(if(ctx.functionReturnType() == null) "void" else ctx.functionReturnType().text, typeScope) + val f = if(ctx.functionParams().readOnlyParams() != null && ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0){ + GenericFunction(identifier, Project.currNamespace, type, ctx.functionBody()) + }else { + Function(identifier, Project.currNamespace,type) + } + //解析参数 + f.addParamsFromContext(ctx.functionParams()) + //TODO 解析函数的注解 + //不是类的成员 + f.ownerType = Function.Companion.OwnerType.NONE + //写入域 + val namespace = GlobalField.localNamespaces[f.namespace]!! + if (!namespace.field.hasFunction(f)) { + namespace.field.addFunction(f,false) + } else { + LogProcessor.error("Already defined function:" + f.namespaceID) + Function.currFunction = Function.nullFunction + } + if (f.isEntrance + && ctx.functionParams().normalParams().parameterList().parameter().size != 0 + && (ctx.functionParams().readOnlyParams() == null || ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0) + ) { + LogProcessor.error("Entrance function shouldn't have parameter:" + f.namespaceID) + } + return null + } + + override fun visitInlineFunctionDeclaration(ctx: mcfppParser.InlineFunctionDeclarationContext): Any? { + Project.ctx = ctx + //创建函数对象 + val f: Function + //是否是内联函数 + val identifier : String = ctx.Identifier().text + f = InlineFunction(identifier, Project.currNamespace, ctx) + //解析参数 + f.addParamsFromContext(ctx.functionParams()) + //TODO 解析函数的注解 + //不是类的成员 + f.ownerType = Function.Companion.OwnerType.NONE + //写入域 + val namespace = GlobalField.localNamespaces[f.namespace]!! + if (!namespace.field.hasFunction(f)) { + namespace.field.addFunction(f,false) + } else { + LogProcessor.error("Already defined function:" + f.namespaceID) + Function.currFunction = Function.nullFunction + } + if (f.isEntrance + && ctx.functionParams().normalParams().parameterList().parameter().size != 0 + && (ctx.functionParams().readOnlyParams() == null || ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0) + ) { + LogProcessor.error("Entrance function shouldn't have parameter:" + f.namespaceID) + } + return null + } + + override fun visitCompileTimeFuncDeclaration(ctx: mcfppParser.CompileTimeFuncDeclarationContext): Any? { + Project.ctx = ctx + //创建函数对象 + val f: Function + //是否是编译时函数 + val identifier : String = ctx.Identifier().text + f = CompileTimeFunction( + identifier,Project.currNamespace, + MCFPPType.parseFromIdentifier(if(ctx.functionReturnType() == null) "void" else ctx.functionReturnType().text, typeScope), + ctx.functionBody() + ) + //解析参数 + f.addParamsFromContext(ctx.functionParams()) + //TODO 解析函数的注解 + //不是类的成员 + f.ownerType = Function.Companion.OwnerType.NONE + //写入域 + val namespace = GlobalField.localNamespaces[f.namespace]!! + if (!namespace.field.hasFunction(f)) { + f.setField(namespace.field) + namespace.field.addFunction(f,false) + } else { + LogProcessor.error("Already defined function:" + f.namespaceID) + Function.currFunction = Function.nullFunction + } + if (f.isEntrance + && ctx.functionParams().normalParams().parameterList().parameter().size != 0 + && (ctx.functionParams().readOnlyParams() == null || ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0) + ) { + LogProcessor.error("Entrance function shouldn't have parameter:" + f.namespaceID) + } + return null + } + + + override fun visitExtensionFunctionDeclaration(ctx: mcfppParser.ExtensionFunctionDeclarationContext?): Any? { + Project.ctx = ctx!! + val ownerType : Function.Companion.OwnerType + //获取被拓展的类 + val data : CompoundData = if(ctx.type().className() == null){ + ownerType = Function.Companion.OwnerType.BASIC + when(ctx.type().text){ + "int" -> MCInt.data + else -> { + LogProcessor.error("Cannot add extension function to ${ctx.type().text}") + return null + } + } + }else{ + val clsStr = ctx.type().className().text.split(":") + val id : String + val nsp : String? + if(clsStr.size == 1){ + id = clsStr[0] + nsp = null + }else{ + id = clsStr[1] + nsp = clsStr[0] + } + val qwq: Class? = GlobalField.getClass(nsp, id) + if (qwq == null) { + val pwp = GlobalField.getTemplate(nsp, id) + if(pwp == null){ + LogProcessor.error("Undefined class or struct:" + ctx.type().className().text) + return null + }else{ + ownerType = Function.Companion.OwnerType.TEMPLATE + pwp + } + }else{ + ownerType = Function.Companion.OwnerType.CLASS + qwq + } + } + //创建函数对象 + val f = if(ctx.functionParams().readOnlyParams() != null && ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0){ + GenericExtensionFunction(ctx.Identifier().text, data, Project.currNamespace, MCFPPType.parseFromIdentifier(ctx.functionReturnType().text, typeScope), ctx.functionBody()) + }else{ + ExtensionFunction(ctx.Identifier().text, data, Project.currNamespace, MCFPPType.parseFromIdentifier(ctx.functionReturnType().text, typeScope)) + } + //解析参数 + f.accessModifier = AccessModifier.PUBLIC + f.ownerType = ownerType + f.isStatic = ctx.STATIC() != null + f.addParamsFromContext(ctx.functionParams()) + val field = if(f.isStatic) data.staticField else data.field + //注册函数 + if (!field.addFunction(f,false)) { + LogProcessor.error("Already defined function:" + ctx.Identifier().text + "in class " + Class.currClass!!.identifier) + Function.currFunction = Function.nullFunction + } + return null + } + + /** + * native函数的声明 + * @param ctx the parse tree + * @return 如果是全局,返回null,否则返回这个函数对象 + */ + + override fun visitNativeFuncDeclaration(ctx: mcfppParser.NativeFuncDeclarationContext): Any? { + Project.ctx = ctx + val nf: NativeFunction = try { + //根据JavaRefer找到类 + val refer = ctx.javaRefer().text + val clsName = refer.substring(0,refer.lastIndexOf('.')) + val clazz = java.lang.Class.forName(clsName).getConstructor().newInstance() + if(clazz !is MNIMethodContainer){ + LogProcessor.error("Class $clsName should extends MNIMethodContainer") + throw IllegalArgumentException("Class $clsName should extends MNIMethodContainer") + } + NativeFunction( + ctx.Identifier().text, + clazz, + ctx.functionReturnType()?.let { MCFPPType.parseFromContext(it.type(),typeScope)}?:MCFPPBaseType.Void, + Project.currNamespace + ) + } catch (e: IllegalFormatException) { + LogProcessor.error("Illegal Java Method Name: " + e.message) + return null + } catch (e: ClassNotFoundException) { + LogProcessor.error("Cannot find java class: " + e.message) + return null + } catch (e: NoSuchMethodException) { + LogProcessor.error("MNIMethodContainer should have a non-parameter constructor: " + e.message) + return null + } catch (e: SecurityException){ + LogProcessor.error("Cannot access to the constructor: " + e.message) + return null + } + nf.addParamsFromContext(ctx.functionParams()) + //写入域 + val namespace = GlobalField.localNamespaces[nf.namespace]!! + //是普通的函数 + nf.ownerType = Function.Companion.OwnerType.NONE + if (!namespace.field.hasFunction(nf)) { + namespace.field.addFunction(nf,false) + } else { + LogProcessor.error("Already defined function:" + ctx.Identifier().text) + Function.currFunction = Function.nullFunction + } + return nf + } +//endregion + +//region template + override fun visitTemplateDeclaration(ctx: TemplateDeclarationContext?): Any? { + Project.ctx = ctx!! + //注册模板 + val id = ctx.classWithoutNamespace().text + val namespace1 = GlobalField.localNamespaces[Project.currNamespace]!! + if (namespace1.field.hasTemplate(id)) { + //重复声明 + LogProcessor.error("Template has been defined: $id in namespace ${Project.currNamespace}") + Template.currTemplate = namespace1.field.getTemplate(id) + } + val template = Template(id, LazyWrapper{MCFPPType.parseFromIdentifier(ctx.type().text, typeScope)}, Project.currNamespace) + if (ctx.className() != null) { + //是否存在继承 + val qwq = ctx.className().text.split(":") + val identifier: String + val namespace : String? + if(qwq.size == 1){ + identifier = qwq[0] + namespace = null + }else{ + namespace = qwq[0] + identifier = qwq[1] + } + val s = GlobalField.getTemplate(namespace, identifier) + if(s == null){ + LogProcessor.error("Undefined struct: " + ctx.className().text) + }else{ + template.parent.add(s) + } + } + namespace1.field.addTemplate(id, template) + Template.currTemplate = template + typeScope = template.field + //解析成员 + //先静态 + isStatic = true + //先解析函数 + for (c in ctx.templateBody().staticTemplateMemberDeclaration()) { + if (c!!.templateMember().templateFunctionDeclaration() != null) { + visit(c) + } + } + //再解析变量 + for (c in ctx.templateBody().staticTemplateMemberDeclaration()) { + if (c!!.templateMember().templateFieldDeclaration() != null) { + visit(c) + } + } + //后成员 + isStatic = false + //先解析函数和构造函数 + for (c in ctx.templateBody().templateMemberDeclaration()) { + if (c!!.templateMember().templateFunctionDeclaration() != null) { + visit(c) + } + } + //再解析变量 + for (c in ctx.templateBody().templateMemberDeclaration()) { + if (c!!.templateMember().templateFieldDeclaration() != null) { + visit(c) + } + } + Template.currTemplate = null + typeScope = MCFPPFile.currFile!!.field + return null + } + + + override fun visitStaticTemplateMemberDeclaration(ctx: mcfppParser.StaticTemplateMemberDeclarationContext): Any? { + Project.ctx = ctx + val m = visit(ctx.templateMember()) as Member + //访问修饰符 + if (ctx.accessModifier() != null) { + m.accessModifier = AccessModifier.valueOf(ctx.accessModifier().text.uppercase(Locale.getDefault())) + } + m.isStatic = true + Template.currTemplate!!.addMember(m) + if(m is Function){ + m.field.removeVar("this") + } + return null + } + + /** + * 类成员的声明。由于函数声明可以后置,因此需要先查明函数声明情况再进行变量的注册以及初始化。 + *
+     * `classMemberDeclaration
+     * :   accessModifier? (STATIC)? classMember
+     * ;
+    `
* + * @param ctx the parse tree + * @return null + */ + + override fun visitTemplateMemberDeclaration(ctx: mcfppParser.TemplateMemberDeclarationContext): Any? { + Project.ctx = ctx + val m = visit(ctx.templateMember()) + val accessModifier = AccessModifier.valueOf(ctx.accessModifier().text.uppercase(Locale.getDefault())) + //访问修饰符 + if(m is Member){ + if (ctx.accessModifier() != null) { + m.accessModifier = accessModifier + } + }else if(m is ArrayList<*>){ + for(v in m){ + (v as Var<*>).accessModifier = accessModifier + } + } + return null + } + + + override fun visitTemplateMember(ctx: mcfppParser.TemplateMemberContext): Any? { + Project.ctx = ctx + return if (ctx.templateFunctionDeclaration() != null) { + visit(ctx.templateFunctionDeclaration()) + } else if (ctx.templateFieldDeclaration() != null) { + visit(ctx.templateFieldDeclaration()) + } else{ + return null + } + } + + override fun visitTemplateFunctionDeclaration(ctx: mcfppParser.TemplateFunctionDeclarationContext): Any { + Project.ctx = ctx + val type = MCFPPType.parseFromIdentifier(if(ctx.functionReturnType() == null) "void" else ctx.functionReturnType().text, typeScope) + //创建函数对象 + val f = if(ctx.functionParams().readOnlyParams() != null && ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0){ + GenericFunction( + ctx.Identifier().text, + Template.currTemplate!!, + ctx.parent is mcfppParser.StaticTemplateMemberDeclarationContext, + type, + ctx.functionBody() + ) + }else { + Function( + ctx.Identifier().text, + Template.currTemplate!!, + ctx.parent is mcfppParser.StaticTemplateMemberDeclarationContext, + type + ) + } + if(!isStatic){ + val varType = Template.currTemplate!!.getType() + val thisObj = Var.build("this",varType , f) + f.field.putVar("this",thisObj) + } + //解析参数 + f.addParamsFromContext(ctx.functionParams()) + //注册函数 + if (Template.currTemplate!!.field.hasFunction(f) || Template.currTemplate!!.staticField.hasFunction(f)) { + LogProcessor.error("Already defined function:" + ctx.Identifier().text + "in struct " + Template.currTemplate!!.identifier) + Function.currFunction = Function.nullFunction + } + return f + } + + override fun visitTemplateFieldDeclaration(ctx: mcfppParser.TemplateFieldDeclarationContext): ArrayList> { + Project.ctx = ctx + val re = ArrayList>() + for (i in ctx.templateFieldDeclarationExpression()){ + //变量生成 + val `var` = visit(i) as Var<*> + re.add(`var`) + } + return re + } + + override fun visitTemplateFieldDeclarationExpression(ctx: mcfppParser.TemplateFieldDeclarationExpressionContext): Var<*>? { + //TODO 地狱绘图(指parent串) + val `var` = UnresolvedVar( + ctx.Identifier().text, + UnresolvedType ((ctx.parent.parent.parent.parent.parent as TemplateDeclarationContext).type().text), + typeScope + ) + //是否是静态的 + `var`.isStatic = isStatic + //只有可能是结构体成员 + if (Template.currTemplate!!.field.containVar(ctx.Identifier().text) || Template.currTemplate!!.staticField.containVar(ctx.Identifier().text) + ) { + LogProcessor.error("Duplicate defined variable name:" + ctx.Identifier().text) + return null + } + return `var` + } + + //endregion +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppFuncManager.kt b/src/main/kotlin/top/mcfpp/antlr/McfppFuncManager.kt new file mode 100644 index 00000000..90dcf8f4 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppFuncManager.kt @@ -0,0 +1,106 @@ +package top.mcfpp.antlr + +import top.mcfpp.lang.* +import top.mcfpp.lang.type.MCFPPType +import top.mcfpp.model.function.Function +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.Member +import top.mcfpp.util.LogProcessor +import kotlin.reflect.KFunction + +/** + * 获取函数用的visitor + */ +class McfppFuncManager{ + + /** + * 获取一个全局函数 + * + * @param namespace + * @param identifier + * @param normalParams + * @return + */ + fun getFunction(namespace: String?, identifier: String, readOnlyParams: List, normalParams: ArrayList): Function { + return GlobalField.getFunction(namespace, identifier, readOnlyParams, normalParams) + } + + /** + * 获取成员函数 + * + * @param curr 一个变量,用于从中选择函数 + * @param identifier 函数的名字 + * @param readOnlyParams 函数的只读参数 + * @param normalParams 函数的普通参数 + * @return + */ + fun getFunction( + curr: Var<*>, + identifier: String, + readOnlyParams: List, + normalParams: ArrayList + ): Function { + //是类的成员方法或扩展方法 + val getter : KFunction> = curr::getMemberFunction + val accessModifier : Member.AccessModifier = if(curr is ClassPointer){ + //类指针 + if(Function.currFunction.ownerType == Function.Companion.OwnerType.CLASS){ + Function.currFunction.parentClass()!!.getAccess(curr.clsType) + }else{ + Member.AccessModifier.PUBLIC + } + }else{ + //基本类型 + Member.AccessModifier.PUBLIC + } + //开始选择函数 + val func = getter.call(identifier, readOnlyParams, normalParams, accessModifier) + if (!func.second){ + LogProcessor.error("Cannot access member $identifier") + } + return func.first + } + + + /** + * 获取一个类的静态函数 + * + * @param type + * @param identifier + * @param readOnlyParams + * @param normalParams + * @return + */ + fun getFunction( + type: CompoundDataType, + identifier : String, + readOnlyParams: List, + normalParams: ArrayList + ): Function { + //是类的成员方法 + val accessModifier = if(Function.currFunction.ownerType == Function.Companion.OwnerType.CLASS){ + Function.currFunction.parentClass()!!.getAccess(type.dataType) + }else{ + Member.AccessModifier.PUBLIC + } + //开始选择函数 + val func = type.getMemberFunction(identifier, readOnlyParams, normalParams, accessModifier) + if (!func.second){ + LogProcessor.error("Cannot access member $identifier in class ${type.dataType.identifier}") + } + return func.first + } + + fun getFunction( + selector: CanSelectMember, + identifier: String, + readOnlyParams: List, + normalParams: ArrayList + ): Function { + return when(selector){ + is CompoundDataType -> getFunction(selector, identifier, readOnlyParams, normalParams) + is Var<*> -> getFunction(selector, identifier, readOnlyParams, normalParams) + else -> throw Exception() + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassFieldVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassFieldVisitor.kt new file mode 100644 index 00000000..9d604931 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassFieldVisitor.kt @@ -0,0 +1,71 @@ +package top.mcfpp.antlr + +import top.mcfpp.Project +import top.mcfpp.io.MCFPPFile +import top.mcfpp.model.Class +import top.mcfpp.model.function.Constructor +import top.mcfpp.model.function.Function +import top.mcfpp.util.LogProcessor + +class McfppGenericClassFieldVisitor(val clazz: Class) : McfppFieldVisitor() { + override fun visitClassDeclaration(ctx: mcfppParser.ClassDeclarationContext): Any? { + Project.ctx = ctx + + Class.currClass = clazz + + typeScope = Class.currClass!!.field + //解析类中的成员 + //先静态 + isStatic = true + //先解析函数 + for (c in ctx.classBody().staticClassMemberDeclaration()) { + c!! + if (c.classMember().classFunctionDeclaration() != null || c.classMember().abstractClassFunctionDeclaration() != null) { + visit(c) + } + } + //再解析变量 + for (c in ctx.classBody().staticClassMemberDeclaration()) { + if (c!!.classMember().classFieldDeclaration() != null) { + visit(c) + } + } + //后成员 + isStatic = false + //先解析函数和构造函数 + for (c in ctx.classBody().classMemberDeclaration()) { + c!! + if (c.classMember() != null && (c.classMember().classFunctionDeclaration() != null || c.classMember().abstractClassFunctionDeclaration() != null)) { + visit(c) + } + } + //再解析变量 + for (c in ctx.classBody().classMemberDeclaration()) { + if (c!!.classMember() != null && c.classMember().classFieldDeclaration() != null) { + visit(c) + } + } + //如果没有构造函数,自动添加默认的空构造函数 + if (Class.currClass!!.constructors.size == 0) { + Class.currClass!!.addConstructor(Constructor(Class.currClass!!)) + } + //是否为抽象类 + if(!Class.currClass!!.isAbstract){ + var il : Function? = null + Class.currClass!!.field.forEachFunction { f -> + run { + if(f.isAbstract){ + il = f + return@run + } + } + } + if(il != null){ + LogProcessor.error("Class ${Class.currClass} must either be declared abstract or implement abstract method ${il!!.nameWithNamespace}") + } + } + Class.currClass = null + typeScope = MCFPPFile.currFile!!.field + return null + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassImVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassImVisitor.kt new file mode 100644 index 00000000..cfb9dbac --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppGenericClassImVisitor.kt @@ -0,0 +1,38 @@ +package top.mcfpp.antlr + +import top.mcfpp.Project +import top.mcfpp.model.Class +import top.mcfpp.model.CompiledGenericClass +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.function.Function + +class McfppGenericClassImVisitor : McfppImVisitor() { + + override fun visitClassBody(ctx: mcfppParser.ClassBodyContext): Any? { + enterClassBody(ctx) + visitChildren(ctx) + exitClassBody(ctx) + return null + } + + /** + * 进入类体。 + * @param ctx the parse tree + */ + private fun enterClassBody(ctx: mcfppParser.ClassBodyContext) { + Project.ctx = ctx + //TODO 注解 + } + + /** + * 离开类体。将缓存重新指向全局 + * @param ctx the parse tree + */ + + private fun exitClassBody(ctx: mcfppParser.ClassBodyContext) { + Project.ctx = ctx + Class.currClass = null + Function.currFunction = Function.nullFunction + } + +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppImVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppImVisitor.kt new file mode 100644 index 00000000..e8e5a46b --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppImVisitor.kt @@ -0,0 +1,1167 @@ +package top.mcfpp.antlr + +import org.antlr.v4.runtime.RuleContext +import top.mcfpp.Project +import top.mcfpp.annotations.InsertCommand +import top.mcfpp.antlr.mcfppParser.CompileTimeFuncDeclarationContext +import top.mcfpp.command.CommandList +import top.mcfpp.command.Commands +import top.mcfpp.exception.* +import top.mcfpp.io.MCFPPFile +import top.mcfpp.lang.* +import top.mcfpp.lang.type.MCFPPBaseType +import top.mcfpp.lang.type.MCFPPGenericClassType +import top.mcfpp.lang.type.MCFPPType +import top.mcfpp.lang.value.MCFPPValue +import top.mcfpp.model.* +import top.mcfpp.model.Annotation +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.field.NamespaceField +import top.mcfpp.model.function.* +import top.mcfpp.model.function.Function +import top.mcfpp.model.function.FunctionParam.Companion.typeToStringList +import top.mcfpp.model.generic.Generic +import top.mcfpp.util.LogProcessor + +open class McfppImVisitor: mcfppParserBaseVisitor() { + + override fun visitTopStatement(ctx: mcfppParser.TopStatementContext): Any? { + if(ctx.statement().size == 0) return null + Function.currFunction = MCFPPFile.currFile!!.topFunction + //注册函数 + GlobalField.localNamespaces[Project.currNamespace]!!.field.addFunction(Function.currFunction, force = false) + super.visitTopStatement(ctx) + Function.currFunction = Function.nullFunction + return null + } + + override fun visitFunctionDeclaration(ctx: mcfppParser.FunctionDeclarationContext): Any? { + if(ctx.parent is CompileTimeFuncDeclarationContext) return null + enterFunctionDeclaration(ctx) + super.visitFunctionDeclaration(ctx) + exitFunctionDeclaration(ctx) + return null + } + + private fun enterFunctionDeclaration(ctx: mcfppParser.FunctionDeclarationContext){ + Project.ctx = ctx + val f: Function + //获取函数对象 + val types = FunctionParam.parseReadonlyAndNormalParamTypes(ctx.functionParams()) + //获取缓存中的对象 + f = GlobalField.getFunctionInner(Project.currNamespace, ctx.Identifier().text, types.first, types.second) + Function.currFunction = f + //对函数进行注解处理 + for (a in annoInCompound){ + a.forFunction(f) + } + annoInCompound.clear() + } + + private fun exitFunctionDeclaration(ctx: mcfppParser.FunctionDeclarationContext){ + Project.ctx = ctx + //函数是否有返回值 + if(Function.currFunction !is Generic<*> && Function.currFunction.returnType != MCFPPBaseType.Void && !Function.currFunction.hasReturnStatement){ + LogProcessor.error("A 'return' expression required in function: " + Function.currFunction.namespaceID) + } + Function.currFunction = Function.nullFunction + if (Class.currClass == null) { + //不在类中 + Function.currFunction = Function.nullFunction + } else { + Function.currFunction = Class.currClass!!.classPreInit + } + } + + override fun visitFunctionBody(ctx: mcfppParser.FunctionBodyContext): Any? { + if(ctx.parent is CompileTimeFuncDeclarationContext) return null + if(Function.currFunction !is Generic<*>){ + super.visitFunctionBody(ctx) + } + return null + } + + + //泛型函数编译使用的入口 + fun visitFunctionBody(ctx: mcfppParser.FunctionBodyContext, function: Function){ + val lastFunction = Function.currFunction + Function.currFunction = function + super.visitFunctionBody(ctx) + Function.currFunction = lastFunction + } + + /** + * 进入命名空间声明的时候 + * @param ctx the parse tree + */ + override fun visitNamespaceDeclaration(ctx: mcfppParser.NamespaceDeclarationContext):Any? { + Project.ctx = ctx + Project.currNamespace = ctx.Identifier(0).text + if(ctx.Identifier().size > 1){ + for (n in ctx.Identifier().subList(1,ctx.Identifier().size-1)){ + Project.currNamespace += ".$n" + } + } + MCFPPFile.currFile!!.topFunction.namespace = Project.currNamespace + return null + } + + /** + * 变量声明 + * @param ctx the parse tree + */ + @InsertCommand + override fun visitFieldDeclaration(ctx: mcfppParser.FieldDeclarationContext):Any? { + Project.ctx = ctx + //变量生成 + val fieldModifier = ctx.fieldModifier()?.text + if (ctx.parent is mcfppParser.ClassMemberContext) { + return null + } + if(ctx.VAR() != null){ + //自动判断类型 + val init: Var<*> = McfppExprVisitor().visit(ctx.expression())!! + val `var` = Var.build(ctx.Identifier().text, init.type, Function.currFunction) + //变量注册 + //一定是函数变量 + if (!Function.field.putVar(ctx.Identifier().text, `var`, true)) { + LogProcessor.error("Duplicate defined variable name:" + ctx.Identifier().text) + } + try { + if(`var` is MCInt && init is MCInt && init !is MCIntConcrete){ + Function.currFunction.commands.replaceThenAnalyze(init.name to `var`.name, init.`object`.name to `var`.`object`.name) + `var`.assignCommand(init, Function.currFunction.commands.last().toString()) + }else{ + `var`.assign(init) + } + } catch (e: VariableConverseException) { + LogProcessor.error("Cannot convert " + init.javaClass + " to " + `var`.javaClass) + throw VariableConverseException() + } + when(fieldModifier){ + "const" -> { + if(!`var`.hasAssigned){ + LogProcessor.error("The const field ${`var`.identifier} must be initialized.") + } + `var`.isConst = true + } + "dynamic" -> { + if(`var` is MCFPPValue<*>){ + `var`.toDynamic(true) + } + } + "import" -> { + `var`.isImport = true + } + } + }else{ + for (c in ctx.fieldDeclarationExpression()){ + val type = MCFPPType.parseFromContext(ctx.type(), Function.currFunction.field) + //函数变量,生成 + var `var` = Var.build(c.Identifier().text, type, Function.currFunction) + //变量注册 + //一定是函数变量 + if (Function.field.containVar(c.Identifier().text)) { + LogProcessor.error("Duplicate defined variable name:" + c.Identifier().text) + } + Function.addCommand("#field: " + ctx.type().text + " " + c.Identifier().text + if (c.expression() != null) " = " + c.expression().text else "") + //变量初始化 + if (c.expression() != null) { + val init: Var<*> = McfppExprVisitor(if(type is MCFPPGenericClassType) type else null).visit(c.expression())!! + try { + if(`var` is MCInt && init is MCInt && init !is MCIntConcrete){ + Function.currFunction.commands.replaceThenAnalyze(init.name to `var`.name, init.`object`.name to `var`.`object`.name) + `var` = `var`.assignCommand(init, Function.currFunction.commands.last().toString()) + }else{ + `var` = `var`.assign(init) + } + } catch (e: VariableConverseException) { + LogProcessor.error("Cannot convert " + init.javaClass + " to " + `var`.javaClass) + throw VariableConverseException(e) + } + } + Function.field.putVar(`var`.identifier, `var`, true) + when(fieldModifier){ + "const" -> { + if(!`var`.hasAssigned){ + LogProcessor.error("The const field ${`var`.identifier} must be initialized.") + } + `var`.isConst = true + } + "dynamic" -> { + if(`var` is MCFPPValue<*>){ + `var`.toDynamic(true) + } + } + "import" -> { + `var`.isImport = true + } + } + } + } + return null + } + + /** + * 一个赋值的语句 + * @param ctx the parse tree + */ + @InsertCommand + override fun visitStatementExpression(ctx: mcfppParser.StatementExpressionContext):Any? { + Project.ctx = ctx + Function.addCommand("#expression: " + ctx.text) + val right: Var<*> = McfppExprVisitor().visit(ctx.expression())!! + if(ctx.basicExpression() != null){ + val left: Var<*> = McfppLeftExprVisitor().visit(ctx.basicExpression())!! + if (left.isConst) { + LogProcessor.error("Cannot assign a constant repeatedly: " + left.identifier) + return null + } + try { + if(left is MCInt && right is MCInt){ + Function.currFunction.commands.replaceThenAnalyze(right.name to left.name, right.`object`.name to left.`object`.name) + left.replacedBy(left.assignCommand(right, Function.currFunction.commands.last().toString())) + }else{ + left.replacedBy(left.assign(right)) + } + } catch (e: VariableConverseException) { + LogProcessor.error("Cannot convert " + right.javaClass + " to " + left.javaClass) + throw VariableConverseException() + } + }else{ + //TODO 只有一个表达式的计算 + } + Function.addCommand("#expression end: " + ctx.text) + return null + } + + val annoInGlobal = ArrayList() + val annoInCompound = ArrayList() + + /** + * 自加或自减语句 + * TODO + * @param ctx the parse tree + */ + /* + * override fun exitSelfAddOrMinusStatement(ctx: mcfppParser.SelfAddOrMinusStatementContext) { + * Project.ctx = ctx + * Function.addCommand("#" + ctx.text) + * val re: Var? = Function.field.getVar(ctx.selfAddOrMinusExpression().Identifier().text) + * if (re == null) { + * LogProcessor.error("Undefined variable:" + ctx.selfAddOrMinusExpression().Identifier().text) + * throw VariableNotDefineException() + * } + * if (ctx.selfAddOrMinusExpression().op.text.equals("++")) { + * if (re is MCInt) { + * if (re.isConcrete) { + * re.value = re.value!! + 1 + * } else { + * Function.addCommand(Commands.SbPlayerAdd(re, 1)) + * } + * } + * } else { + * if (re is MCInt) { + * if (re.isConcrete) { + * re.value = re.value!! - 1 + * } else { + * Function.addCommand(Commands.SbPlayerRemove(re, 1)) + * } + * } + * } + * } + */ + + override fun visitExtensionFunctionDeclaration(ctx: mcfppParser.ExtensionFunctionDeclarationContext): Any? { + //是扩展函数 + enterExtensionFunctionDeclaration(ctx) + super.visitExtensionFunctionDeclaration(ctx) + exitExtensionFunctionDeclaration(ctx) + + return null + } + + fun enterExtensionFunctionDeclaration(ctx: mcfppParser.ExtensionFunctionDeclarationContext) { + val f: Function + val data: CompoundData = if (ctx.type().className() == null) { + when (ctx.type().text) { + "int" -> MCInt.data + else -> { + throw Exception("Cannot add extension function to ${ctx.type().text}") + } + } + } else { + val clsStr = ctx.type().className().text.split(":") + val id: String + val nsp: String? + if (clsStr.size == 1) { + id = clsStr[0] + nsp = null + } else { + id = clsStr[1] + nsp = clsStr[0] + } + val owo: Class? = GlobalField.getClass(nsp, id) + if (owo == null) { + val pwp = GlobalField.getTemplate(nsp, id) + if (pwp == null) { + LogProcessor.error("Undefined class or struct:" + ctx.type().className().text) + f = UnknownFunction(ctx.Identifier().text) + Function.currFunction = f + return + } else { + pwp + } + } else { + owo + } + } + //解析参数 + val types = FunctionParam.parseReadonlyAndNormalParamTypes(ctx.functionParams()) + val field = if (ctx.STATIC() != null) data.staticField else data.field + //获取缓存中的对象 + f = field.getFunction(ctx.Identifier().text, types.first, types.second) + + Function.currFunction = f + + for (a in annoInGlobal) { + a.forFunction(f) + } + annoInGlobal.clear() + } + + fun exitExtensionFunctionDeclaration(ctx: mcfppParser.ExtensionFunctionDeclarationContext) { + Project.ctx = ctx + //函数是否有返回值 + if (Function.currFunction.returnType != MCFPPBaseType.Void && !Function.currFunction.hasReturnStatement) { + LogProcessor.error("A 'return' expression required in function: " + Function.currFunction.namespaceID) + } + Function.currFunction = Function.nullFunction + } + +//region 逻辑语句 + + @InsertCommand + override fun visitReturnStatement(ctx: mcfppParser.ReturnStatementContext):Any? { + Project.ctx = ctx + Function.addCommand("#" + ctx.text) + if (ctx.expression() != null) { + val ret: Var<*> = McfppExprVisitor().visit(ctx.expression())!! + Function.currBaseFunction.assignReturnVar(ret) + } + if(Function.currFunction !is InternalFunction) + Function.currFunction.hasReturnStatement = true + Function.addCommand("return 1") + return null + } + + override fun visitIfStatement(ctx: mcfppParser.IfStatementContext): Any? { + enterIfStatement(ctx) + super.visitIfStatement(ctx) + exitIfStatement(ctx) + return null + } + + /** + * 进入if语句 + * Enter if statement + * + * @param ctx + */ + + @InsertCommand + fun enterIfStatement(ctx: mcfppParser.IfStatementContext) { + //进入if函数 + Project.ctx = ctx + Function.addCommand("#" + "if start") + val ifFunction = InternalFunction("_if_", Function.currFunction) + ifFunction.invoke(ArrayList(),null) + Function.currFunction = ifFunction + if(!GlobalField.localNamespaces.containsKey(ifFunction.namespace)) + GlobalField.localNamespaces[ifFunction.namespace] = Namespace(ifFunction.namespace) + GlobalField.localNamespaces[ifFunction.namespace]!!.field.addFunction(ifFunction,false) + } + + /** + * 离开if语句 + * Exit if statement + * + * @param ctx + */ + @InsertCommand + fun exitIfStatement(ctx: mcfppParser.IfStatementContext) { + Project.ctx = ctx + Function.currFunction = Function.currFunction.parent[0] + //调用完毕,将子函数的栈销毁 + Function.addCommand("#" + "if end") + } + + override fun visitIfBlock(ctx: mcfppParser.IfBlockContext): Any? { + enterIfBlock(ctx) + super.visitIfBlock(ctx) + exitIfBlock(ctx) + return null + } + + /** + * 进入if分支的语句块 + * @param ctx the parse tree + */ + + @InsertCommand + fun enterIfBlock(ctx: mcfppParser.IfBlockContext) { + Project.ctx = ctx + val parent = ctx.parent + Function.addCommand("#if branch start") + //匿名函数的定义 + val f = InternalFunction("_if_branch_", Function.currFunction) + //注册函数 + if(!GlobalField.localNamespaces.containsKey(f.namespace)) + GlobalField.localNamespaces[f.namespace] = Namespace(f.namespace) + GlobalField.localNamespaces[f.namespace]!!.field.addFunction(f,false) + if (parent is mcfppParser.IfStatementContext || parent is mcfppParser.ElseIfStatementContext) { + //第一个if + parent as mcfppParser.IfStatementContext + val exp = McfppExprVisitor().visit(parent.expression()) + if(exp !is MCBool){ + throw TypeCastException() + } + if (exp is MCBoolConcrete && exp.value) { + //函数调用的命令 + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand("function " + f.namespaceID) + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + Function.addCommand("return 1") + LogProcessor.warn("The condition is always true. ") + } else if (exp is MCBoolConcrete) { + Function.addCommand("#function " + f.namespaceID) + Function.addCommand("return 1") + LogProcessor.warn("The condition is always false. ") + } else { + exp as ReturnedMCBool + val exp1 = MCBool() + exp1.assign(exp) + //给子函数开栈 + Function.addCommand( + "execute " + + "if score " + exp1.name + " " + SbObject.MCFPP_boolean + " matches 1 " + + "run data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}" + ) + Function.addCommand( + "execute " + + "if score " + exp1.name + " " + SbObject.MCFPP_boolean + " matches 1 " + + "run function " + f.namespaceID + ) + Function.addCommand( + "execute " + + "if score " + exp1.name + " " + SbObject.MCFPP_boolean + " matches 1 " + + "run data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]" + ) + //由于下一个函数被直接中断,因此需要自己把自己的栈去掉 + Function.addCommand( + "execute " + + "if score " + exp1.name + " " + SbObject.MCFPP_boolean + " matches 1 " + + "run data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]" + ) + Function.addCommand( + "execute " + + "if score " + exp1.name + " " + SbObject.MCFPP_boolean + " matches 1 " + + "run return 1" + ) + } + } + else { + //else语句 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand("function " + f.namespaceID) + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + } + Function.currFunction = f + } + + /** + * 离开if语句块 + * @param ctx the parse tree + */ + + @InsertCommand + fun exitIfBlock(ctx: mcfppParser.IfBlockContext) { + Project.ctx = ctx + Function.currFunction = Function.currFunction.parent[0] + Function.addCommand("#if branch end") + } + + override fun visitWhileStatement(ctx: mcfppParser.WhileStatementContext): Any? { + enterWhileStatement(ctx) + super.visitWhileStatement(ctx) + exitWhileStatement(ctx) + return null + } + + @InsertCommand + fun enterWhileStatement(ctx: mcfppParser.WhileStatementContext) { + //进入if函数 + Project.ctx = ctx + Function.addCommand("#while start") + val whileFunction = InternalFunction("_while_", Function.currFunction) + Function.addCommand("function " + whileFunction.namespaceID) + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + Function.currFunction = whileFunction + if(!GlobalField.localNamespaces.containsKey(whileFunction.namespace)) + GlobalField.localNamespaces[whileFunction.namespace] = Namespace(whileFunction.namespace) + GlobalField.localNamespaces[whileFunction.namespace]!!.field.addFunction(whileFunction,false) + } + + + @InsertCommand + fun exitWhileStatement(ctx: mcfppParser.WhileStatementContext) { + Project.ctx = ctx + Function.currFunction = Function.currFunction.parent[0] + //调用完毕,将子函数的栈销毁 + Function.addCommand("#while end") + } + + + override fun visitWhileBlock(ctx: mcfppParser.WhileBlockContext): Any? { + enterWhileBlock(ctx) + super.visitWhileBlock(ctx) + exitWhileBlock(ctx) + return null + } + + /** + * 进入while语句块 + * @param ctx the parse tree + */ + + @InsertCommand + fun enterWhileBlock(ctx: mcfppParser.WhileBlockContext) { + Project.ctx = ctx + //入栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand("#" + "while start") + val parent: mcfppParser.WhileStatementContext = ctx.parent as mcfppParser.WhileStatementContext + val exp: MCBool = McfppExprVisitor().visit(parent.expression()) as MCBool + //匿名函数的定义 + val f: Function = InternalFunction("_while_block_", Function.currFunction) + f.child.add(f) + f.parent.add(f) + if(!GlobalField.localNamespaces.containsKey(f.namespace)) + GlobalField.localNamespaces[f.namespace] = Namespace(f.namespace) + GlobalField.localNamespaces[f.namespace]!!.field.addFunction(f,false) + //条件判断 + if (exp is MCBoolConcrete && exp.value) { + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand( + "execute " + + "if function " + f.namespaceID + " " + + "run function " + Function.currFunction.namespaceID + ) + LogProcessor.warn("The condition is always true. ") + } else if (exp is MCBoolConcrete) { + //给子函数开栈 + Function.addCommand("#function " + f.namespaceID) + LogProcessor.warn("The condition is always false. ") + } else { + exp as ReturnedMCBool + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + //函数返回1才会继续执行(continue或者正常循环完毕),返回0则不继续循环(break) + Function.addCommand( + "execute " + + "if function " + exp.parentFunction.namespaceID + " " + + "if function " + f.namespaceID + " " + + "run function " + Function.currFunction.namespaceID + ) + } + Function.currFunction = f //后续块中的命令解析到递归的函数中 + + } + + /** + * 离开while语句块 + * @param ctx the parse tree + */ + + @InsertCommand + fun exitWhileBlock(ctx: mcfppParser.WhileBlockContext) { + Project.ctx = ctx + //调用完毕,将子函数的栈销毁 + //由于在同一个命令中完成了两个函数的调用,因此需要在子函数内部进行子函数栈的销毁工作 + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + //这里取出while函数的栈 + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + Function.addCommand("return 1") + Function.currFunction = Function.currFunction.parent[0] + Function.addCommand("#while loop end") + } + + override fun visitDoWhileStatement(ctx: mcfppParser.DoWhileStatementContext): Any? { + enterDoWhileStatement(ctx) + super.visitDoWhileStatement(ctx) + exitDoWhileStatement(ctx) + return null + } + + @InsertCommand + fun enterDoWhileStatement(ctx: mcfppParser.DoWhileStatementContext) { + //进入do-while函数 + Project.ctx = ctx + Function.addCommand("#do-while start") + val doWhileFunction = InternalFunction("_dowhile_", Function.currFunction) + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand("function " + doWhileFunction.namespaceID) + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + Function.currFunction = doWhileFunction + if(!GlobalField.localNamespaces.containsKey(doWhileFunction.namespace)) + GlobalField.localNamespaces[doWhileFunction.namespace] = Namespace(doWhileFunction.namespace) + GlobalField.localNamespaces[doWhileFunction.namespace]!!.field.addFunction(doWhileFunction,false) + } + + + + /** + * 离开do-while语句 + * @param ctx the parse tree + */ + + @InsertCommand + fun exitDoWhileStatement(ctx: mcfppParser.DoWhileStatementContext) { + Project.ctx = ctx + Function.currFunction = Function.currFunction.parent[0] + //调用完毕,将子函数的栈销毁 + Function.addCommand("#do-while end") + } + + + override fun visitDoWhileBlock(ctx: mcfppParser.DoWhileBlockContext): Any? { + enterDoWhileBlock(ctx) + super.visitDoWhileBlock(ctx) + exitDoWhileBlock(ctx) + return null + } + + /** + * 进入do-while语句块,开始匿名函数调用 + * @param ctx the parse tree + */ + + @InsertCommand + fun enterDoWhileBlock(ctx: mcfppParser.DoWhileBlockContext) { + Project.ctx = ctx + Function.addCommand("#do while start") + //匿名函数的定义 + val f: Function = InternalFunction("_dowhile_", Function.currFunction) + f.child.add(f) + f.parent.add(f) + if(!GlobalField.localNamespaces.containsKey(f.namespace)) { + GlobalField.localNamespaces[f.namespace] = Namespace(f.namespace) + } + GlobalField.localNamespaces[f.namespace]!!.field.addFunction(f,false) + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand( + "execute " + + "unless function " + f.namespaceID + " " + + "run return 1" + ) + val parent = ctx.parent as mcfppParser.DoWhileStatementContext + val exp: MCBool = McfppExprVisitor().visit(parent.expression()) as MCBool + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + //递归调用 + if (exp is MCBoolConcrete && exp.value) { + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand( + "execute " + + "if function " + f.namespaceID + " " + + "run function " + Function.currFunction.namespaceID + ) + LogProcessor.warn("The condition is always true. ") + } else if (exp is MCBoolConcrete) { + //给子函数开栈 + Function.addCommand("#" + Commands.function(Function.currFunction)) + LogProcessor.warn("The condition is always false. ") + } else { + exp as ReturnedMCBool + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand( + "execute " + + "if function ${exp.parentFunction.namespaceID} " + + "run " + Commands.function(Function.currFunction) + ) + } + Function.currFunction = f //后续块中的命令解析到递归的函数中 + } + + + @InsertCommand + fun exitDoWhileBlock(ctx: mcfppParser.DoWhileBlockContext) { + Project.ctx = ctx + //调用完毕,将子函数的栈销毁 + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + //调用完毕,将子函数的栈销毁 + Function.currFunction = Function.currFunction.parent[0] + Function.addCommand("#do while end") + } + + + override fun visitForStatement(ctx: mcfppParser.ForStatementContext): Any? { + enterForStatement(ctx) + super.visitForStatement(ctx) + exitForStatement(ctx) + return null + } + + /** + * 整个for语句本身额外有一个栈,无条件调用函数 + * @param ctx the parse tree + */ + + @InsertCommand + fun enterForStatement(ctx: mcfppParser.ForStatementContext) { + Project.ctx = ctx + Function.addCommand("#for start") + val forFunc: Function = InternalFunction("_for_", Function.currFunction) + forFunc.parent.add(Function.currFunction) + if(!GlobalField.localNamespaces.containsKey(forFunc.namespace)) + GlobalField.localNamespaces[forFunc.namespace] = Namespace(forFunc.identifier) + GlobalField.localNamespaces[forFunc.namespace]!!.field.addFunction(forFunc,false) + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand(Commands.function(forFunc)) + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + Function.currFunction = forFunc + } + + + @InsertCommand + fun exitForStatement(ctx: mcfppParser.ForStatementContext) { + Project.ctx = ctx + Function.currFunction = Function.currFunction.parent[0] + Function.addCommand("#for end") + } + + override fun visitForInit(ctx: mcfppParser.ForInitContext): Any? { + enterForInit(ctx) + super.visitForInit(ctx) + exitForInit(ctx) + return null + } + + @InsertCommand + fun enterForInit(ctx: mcfppParser.ForInitContext) { + Project.ctx = ctx + Function.addCommand("#for init start") + } + + + @InsertCommand + fun exitForInit(ctx: mcfppParser.ForInitContext) { + Project.ctx = ctx + Function.addCommand("#for init end") + //进入for循环主体 + Function.addCommand("#for loop start") + val forLoopFunc: Function = InternalFunction("_for_loop_", Function.currFunction) + forLoopFunc.parent.add(Function.currFunction) + if(!GlobalField.localNamespaces.containsKey(forLoopFunc.namespace)) + GlobalField.localNamespaces[forLoopFunc.namespace] = Namespace(forLoopFunc.identifier) + GlobalField.localNamespaces[forLoopFunc.namespace]!!.field.addFunction(forLoopFunc,false) + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand(Commands.function(forLoopFunc)) + + } + + + /** + * 进入for update语句块。 + * 由于在编译过程中,编译器会首先编译for语句的for control部分,也就是for后面的括号,这就意味着forUpdate语句将会先forBlock + * 被写入到命令函数中。因此我们需要将forUpdate语句中的命令临时放在一个列表内部,然后在forBlock调用完毕后加上它的命令 + * + * @param ctx the parse tree + */ + + override fun visitForUpdate(ctx: mcfppParser.ForUpdateContext): Any? { + enterForUpdate(ctx) + super.visitForUpdate(ctx) + exitForUpdate(ctx) + return null + } + + fun enterForUpdate(ctx: mcfppParser.ForUpdateContext) { + Project.ctx = ctx + forInitCommands = Function.currFunction.commands + Function.currFunction.commands = forUpdateCommands + } + + //暂存 + private var forInitCommands = CommandList() + private var forUpdateCommands = CommandList() + + /** + * 离开for update。暂存for update缓存,恢复主缓存,准备forblock编译 + * @param ctx the parse tree + */ + + fun exitForUpdate(ctx: mcfppParser.ForUpdateContext) { + Project.ctx = ctx + Function.currFunction.commands = forInitCommands + } + + override fun visitForBlock(ctx: mcfppParser.ForBlockContext): Any? { + enterForBlock(ctx) + super.visitForBlock(ctx) + exitForBlock(ctx) + return null + } + + /** + * 进入for block语句。此时当前函数为父函数 + * @param ctx the parse tree + */ + + @InsertCommand + fun enterForBlock(ctx: mcfppParser.ForBlockContext) { + Project.ctx = ctx + val parent: mcfppParser.ForStatementContext = ctx.parent as mcfppParser.ForStatementContext + val exp: MCBool = McfppExprVisitor().visit(parent.forControl().expression()) as MCBool + //匿名函数的定义。这里才是正式的for函数哦喵 + val f: Function = InternalFunction("_forblock_", Function.currFunction) + f.child.add(f) + f.parent.add(f) + if(!GlobalField.localNamespaces.containsKey(f.namespace)) + GlobalField.localNamespaces[f.namespace] = Namespace(f.namespace) + GlobalField.localNamespaces[f.namespace]!!.field.addFunction(f,false) + //条件循环判断 + if (exp is MCBoolConcrete && exp.value) { + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + Function.addCommand( + "execute " + + "if function " + f.namespaceID + " " + + "run function " + Function.currFunction.namespaceID + ) + LogProcessor.warn("The condition is always true. ") + } else if (exp is MCBoolConcrete) { + //给子函数开栈 + Function.addCommand("#function " + f.namespaceID) + LogProcessor.warn("The condition is always false. ") + } else { + exp as ReturnedMCBool + //给子函数开栈 + Function.addCommand("data modify storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame prepend value {}") + //函数返回1才会继续执行(continue或者正常循环完毕),返回0则不继续循环(break) + Function.addCommand( + "execute " + + "if function ${exp.parentFunction.namespaceID} " + + "if function " + f.namespaceID + " " + + "run function " + Function.currFunction.namespaceID + ) + } + //调用完毕,将子函数的栈销毁。这条命令仍然是在for函数中的。 + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + Function.currFunction = f //后续块中的命令解析到递归的函数中 + } + + /** + * 离开for block语句。此时当前函数仍然是for的函数 + * @param ctx the parse tree + */ + + @InsertCommand + fun exitForBlock(ctx: mcfppParser.ForBlockContext) { + Project.ctx = ctx + //for-update的命令压入 + Function.currFunction.commands.addAll(forUpdateCommands) + forUpdateCommands.clear() + //调用完毕,将子函数的栈销毁 + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + //继续销毁for-loop函数的栈 + Function.addCommand("data remove storage mcfpp:system " + Project.config.defaultNamespace + ".stack_frame[0]") + Function.currFunction = Function.currFunction.parent[0] + } +//endregion + + + @InsertCommand + override fun visitOrgCommand(ctx: mcfppParser.OrgCommandContext):Any? { + Project.ctx = ctx + Function.addCommand(ctx.text.substring(1)) + return null + } + + /** + * 进入任意语句,检查此函数是否还能继续添加语句 + * @param ctx the parse tree + */ + + @InsertCommand + override fun visitStatement(ctx: mcfppParser.StatementContext): Any? { + Project.ctx = ctx + if (Function.currFunction.isEnd) { + LogProcessor.warn("Unreachable code: " + ctx.text) + } + super.visitStatement(ctx) + return null + } + + private var temp: MCBool? = null + + @InsertCommand + override fun visitControlStatement(ctx: mcfppParser.ControlStatementContext):Any? { + Project.ctx = ctx + if (!inLoopStatement(ctx)) { + LogProcessor.error("'continue' or 'break' can only be used in loop statements.") + return null + } + Function.addCommand("#" + ctx.text) + //return语句 + if(ctx.BREAK() != null){ + Function.addCommand("return 0") + }else{ + Function.addCommand("return 1") + } + Function.currFunction.isEnd = true + return null + } + + //region class + + /** + * 注解 + * + * @param ctx + */ + //TODO: Func + override fun visitClassAnnotation(ctx: mcfppParser.ClassAnnotationContext): Any? { + Project.ctx = ctx + val anno = GlobalField.annotations[ctx.id.text] + if(anno == null){ + LogProcessor.error("Annotation ${ctx.id.text} not found") + return null + } + //参数获取 + val normalArgs: ArrayList> = ArrayList() + val readOnlyParams: ArrayList> = ArrayList() + val exprVisitor = McfppExprVisitor() + ctx.arguments().readOnlyArgs()?.let { + for (expr in it.expressionList().expression()) { + val arg = exprVisitor.visit(expr)!! + readOnlyParams.add(arg) + } + } + for (expr in ctx.arguments().normalArgs().expressionList().expression()) { + val arg = exprVisitor.visit(expr)!! + normalArgs.add(arg) + } + if(Class.currClass == null && Template.currTemplate == null){ + //在全局 + annoInGlobal.add(Annotation.newInstance(anno,normalArgs)) + }else{ + annoInCompound.add(Annotation.newInstance(anno,normalArgs)) + } + return null + } + + override fun visitClassDeclaration(ctx: mcfppParser.ClassDeclarationContext): Any? { + if(ctx.readOnlyParams() == null){ + super.visitClassDeclaration(ctx) + } + return null + } + + override fun visitClassBody(ctx: mcfppParser.ClassBodyContext): Any? { + enterClassBody(ctx) + super.visitClassBody(ctx) + exitClassBody(ctx) + return null + } + + /** + * 进入类体。 + * @param ctx the parse tree + */ + private fun enterClassBody(ctx: mcfppParser.ClassBodyContext) { + Project.ctx = ctx + //获取类的对象 + val parent: mcfppParser.ClassDeclarationContext = ctx.parent as mcfppParser.ClassDeclarationContext + val identifier: String = parent.classWithoutNamespace().text + //设置作用域 + Class.currClass = GlobalField.getClass(Project.currNamespace, identifier) + Function.currFunction = Class.currClass!!.classPreInit + //注解 + for (a in annoInGlobal){ + a.forClass(Class.currClass!!) + } + annoInGlobal.clear() + } + + /** + * 离开类体。将缓存重新指向全局 + * @param ctx the parse tree + */ + + private fun exitClassBody(ctx: mcfppParser.ClassBodyContext) { + Project.ctx = ctx + Class.currClass = null + Function.currFunction = Function.nullFunction + } + + /** + * 类成员的声明 + * @param ctx the parse tree + */ + + override fun visitClassMemberDeclaration(ctx: mcfppParser.ClassMemberDeclarationContext):Any? { + Project.ctx = ctx + val memberContext: mcfppParser.ClassMemberContext = ctx.classMember()?:return null + if (memberContext.classFunctionDeclaration() != null) { + //函数声明由函数的listener处理 + visit(memberContext.classFunctionDeclaration()) + return null + } + return null + } + + override fun visitClassFunctionDeclaration(ctx: mcfppParser.ClassFunctionDeclarationContext): Any? { + //是类的成员函数 + enterClassFunctionDeclaration(ctx) + super.visitClassFunctionDeclaration(ctx) + exitClassFunctionDeclaration(ctx) + return null + } + + fun enterClassFunctionDeclaration(ctx: mcfppParser.ClassFunctionDeclarationContext) { + Project.ctx = ctx + //解析参数 + val types = FunctionParam.parseReadonlyAndNormalParamTypes(ctx.functionParams()) + //获取缓存中的对象 + val fun1 = Class.currClass!!.field.getFunction(ctx.Identifier().text, types.first, types.second) + val f = if(fun1 is UnknownFunction) Class.currClass!!.staticField.getFunction(ctx.Identifier().text, types.first, types.second) else fun1 + Function.currFunction = f + + //对函数进行注解处理 + for (a in annoInCompound){ + a.forFunction(f) + } + annoInCompound.clear() + } + + fun exitClassFunctionDeclaration(ctx: mcfppParser.ClassFunctionDeclarationContext) { + Project.ctx = ctx + Function.currFunction = Class.currClass!!.classPreInit + } + + override fun visitConstructorDeclaration(ctx: mcfppParser.ConstructorDeclarationContext): Any? { + //是构造函数 + enterConstructorDeclaration(ctx) + super.visitConstructorDeclaration(ctx) + exitConstructorDeclaration(ctx) + return null + } + + fun enterConstructorDeclaration(ctx: mcfppParser.ConstructorDeclarationContext) { + Project.ctx = ctx + val types = FunctionParam.parseNormalParamTypes(ctx.normalParams()) + val c = Class.currClass!!.getConstructor(types.typeToStringList())!! + Function.currFunction = c + //注解 + for (a in annoInCompound){ + a.forFunction(c) + } + annoInCompound.clear() + } + + fun exitConstructorDeclaration(ctx: mcfppParser.ConstructorDeclarationContext) { + Project.ctx = ctx + Function.currFunction = Class.currClass!!.classPreInit + } + //endregion + + //region struct + + /** + * 进入类体。 + * @param ctx the parse tree + */ + + override fun visitTemplateBody(ctx: mcfppParser.TemplateBodyContext): Any? { + enterTemplateBody(ctx) + super.visitTemplateBody(ctx) + exitTemplateBody(ctx) + return null + } + + fun enterTemplateBody(ctx: mcfppParser.TemplateBodyContext) { + Project.ctx = ctx + //获取类的对象 + val parent = ctx.parent as mcfppParser.TemplateDeclarationContext + val identifier: String = parent.classWithoutNamespace().text + //设置作用域 + Template.currTemplate = GlobalField.getTemplate(Project.currNamespace, identifier) + } + + /** + * 离开类体。将缓存重新指向全局 + * @param ctx the parse tree + */ + + fun exitTemplateBody(ctx: mcfppParser.TemplateBodyContext) { + Project.ctx = ctx + Template.currTemplate = null + } + + override fun visitTemplateFunctionDeclaration(ctx: mcfppParser.TemplateFunctionDeclarationContext): Any? { + enterTemplateFunctionDeclaration(ctx) + super.visitTemplateFunctionDeclaration(ctx) + exitTemplateFunctionDeclaration(ctx) + return null + } + + fun enterTemplateFunctionDeclaration(ctx: mcfppParser.TemplateFunctionDeclarationContext) { + Project.ctx = ctx + //解析参数 + val types = FunctionParam.parseReadonlyAndNormalParamTypes(ctx.functionParams()) + //获取缓存中的对象 + val fun1 = Template.currTemplate!!.field.getFunction(ctx.Identifier().text, types.first, types.second) + val f = if(fun1 is UnknownFunction) Template.currTemplate!!.staticField.getFunction(ctx.Identifier().text, types.first, types.second) else fun1 + Function.currFunction = f + + //对函数进行注解处理 + for (a in annoInCompound){ + a.forFunction(f) + } + annoInCompound.clear() + } + + fun exitTemplateFunctionDeclaration(ctx: mcfppParser.TemplateFunctionDeclarationContext) { + Project.ctx = ctx + Function.currFunction = Function.nullFunction + } + + //endregion + + companion object { + /** + * 判断这个语句是否在循环语句中。包括嵌套形式。 + * @param ctx 需要判断的语句 + * @return 是否在嵌套中 + */ + private fun inLoopStatement(ctx: RuleContext): Boolean { + if (ctx is mcfppParser.ForStatementContext) { + return true + } + if (ctx is mcfppParser.DoWhileStatementContext) { + return true + } + if (ctx is mcfppParser.WhileStatementContext) { + return true + } + return if (ctx.parent != null) { + inLoopStatement(ctx.parent) + } else false + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppInlineFunctionVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppInlineFunctionVisitor.kt new file mode 100644 index 00000000..51293bca --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppInlineFunctionVisitor.kt @@ -0,0 +1,5 @@ +package top.mcfpp.antlr + +class McfppInlineFunctionVisitor:McfppImVisitor(){ + +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppLeftExprVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppLeftExprVisitor.kt new file mode 100644 index 00000000..580b72fa --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppLeftExprVisitor.kt @@ -0,0 +1,228 @@ +package top.mcfpp.antlr + +import top.mcfpp.Project +import top.mcfpp.annotations.InsertCommand +import top.mcfpp.lang.* +import top.mcfpp.model.* +import top.mcfpp.model.function.Function +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.function.ExtensionFunction +import top.mcfpp.model.function.FunctionParam +import top.mcfpp.model.function.UnknownFunction +import top.mcfpp.model.generic.Generic +import top.mcfpp.model.generic.GenericClass +import top.mcfpp.util.LogProcessor +import top.mcfpp.util.StringHelper +import java.util.* +import kotlin.collections.ArrayList + +class McfppLeftExprVisitor : mcfppParserBaseVisitor?>(){ + private var currSelector : CanSelectMember? = null + /** + * 计算一个基本的表达式。可能是一个变量,也可能是一个数值 + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitBasicExpression(ctx: mcfppParser.BasicExpressionContext): Var<*>? { + Project.ctx = ctx + return if (ctx.primary() != null) { + visit(ctx.primary()) + } else { + visit(ctx.varWithSelector()) + } + } + + /** + * 从类中选择一个成员。返回的成员包含了它所在的对象的信息 + * + * @param ctx + * @return + */ + @Override + override fun visitVarWithSelector(ctx: mcfppParser.VarWithSelectorContext): Var<*>? { + Project.ctx = ctx + currSelector = if(ctx.primary() != null){ + visit(ctx.primary()) + }else{ + if(ctx.type().className() != null){ + //ClassName + val clsstr = StringHelper.splitNamespaceID(ctx.type().text) + val qwq: Class? = GlobalField.getClass(clsstr.first, clsstr.second) + if (qwq == null) { + LogProcessor.error("Undefined class:" + ctx.type().className().text) + return UnknownVar("${ctx.type().className().text}_type_" + UUID.randomUUID()) + } + qwq.getType() + }else{ + CompoundDataType( + //基本类型 + when(ctx.type().text){ + "int" -> MCInt.data + else -> TODO() + } + ) + } + } + for (selector in ctx.selector().subList(0,ctx.selector().size-1)){ + visit(selector) + } + return visit(ctx.selector(ctx.selector().size-1).`var`()) + } + + @Override + override fun visitSelector(ctx: mcfppParser.SelectorContext?): Var<*>? { + currSelector = visit(ctx!!.`var`())!!.getTempVar() + return null + } + + /** + * 一个初级表达式,可能是一个变量,也可能是一个数值 + * @param ctx the parse tree + * @return 表达式的值 + */ + @Override + override fun visitPrimary(ctx: mcfppParser.PrimaryContext): Var<*>? { + Project.ctx = ctx + if (ctx.`var`() != null) { + //变量 + return visit(ctx.`var`()) + } else if (ctx.value() != null) { + //数字 + val num: mcfppParser.ValueContext = ctx.value() + if (num.intValue() != null) { + return MCIntConcrete(Integer.parseInt(num.intValue().text)) + } else if (num.LineString() != null) { + val r: String = num.LineString().text + return MCString(r.substring(1, r.length - 1)) + } + } else { + //this或者super + val s = if(ctx.SUPER() != null){ + "super" + }else{ + "this" + } + val re: Var<*>? = Function.field.getVar(s) + if (re == null) { + LogProcessor.error("$s can only be used in member functions.") + } + return re + } + return null + } + + /** + * 变量 + * @param ctx the parse tree + * @return 变量 + */ + @Override + @InsertCommand + override fun visitVar(ctx: mcfppParser.VarContext): Var<*>? { + Project.ctx = ctx + return if (ctx.Identifier() != null && ctx.arguments() == null) { + // Identifier identifierSuffix* + if (ctx.identifierSuffix() == null || ctx.identifierSuffix().size == 0) { + //没有数组选取 + val qwq: String = ctx.Identifier().text + if(currSelector == null){ + val re: Var<*>? = Function.field.getVar(qwq) + if (re == null) { + LogProcessor.error("Undefined variable:$qwq") + } + re + }else{ + val cpd = when(currSelector){ + is CompoundDataType -> (currSelector as CompoundDataType).dataType + is ClassPointer -> (currSelector as ClassPointer).clsType + else -> TODO() + } + val am = if(Function.currFunction !is ExtensionFunction && Function.currFunction.ownerType == Function.Companion.OwnerType.CLASS){ + Function.currFunction.parentClass()!!.getAccess(cpd) + }else if(Function.currFunction !is ExtensionFunction && Function.currFunction.ownerType == Function.Companion.OwnerType.TEMPLATE){ + Function.currFunction.parentStruct()!!.getAccess(cpd) + }else{ + Member.AccessModifier.PUBLIC + } + val re = currSelector!!.getMemberVar(qwq,am) + if (re.first == null) { + LogProcessor.error("Undefined variable:$qwq") + } + if (!re.second){ + LogProcessor.error("Cannot access member $qwq") + } + re.first + } + } else { + TODO("数组调用") + } + } else if (ctx.expression() != null) { + // '(' expression ')' + visit(ctx.expression()) + } else { + //函数的调用 + Function.addCommand("#" + ctx.text) + //参数获取 + val normalArgs: ArrayList> = ArrayList() + val readOnlyArgs: ArrayList> = ArrayList() + val exprVisitor = McfppExprVisitor() + for (expr in ctx.arguments().readOnlyArgs()?.expressionList()?.expression()?: emptyList()) { + val arg = exprVisitor.visit(expr)!! + readOnlyArgs.add(arg) + } + for (expr in ctx.arguments().normalArgs().expressionList()?.expression()?: emptyList()) { + val arg = exprVisitor.visit(expr)!! + normalArgs.add(arg) + } + //获取函数 + val p = StringHelper.splitNamespaceID(ctx.namespaceID().text) + val func = if(currSelector == null){ + GlobalField.getFunction(p.first, p.second, FunctionParam.getArgTypeNames(readOnlyArgs), FunctionParam.getArgTypeNames(normalArgs)) + }else{ + if(p.first != null){ + LogProcessor.warn("Invalid namespace usage ${p.first} in function call ") + } + McfppFuncManager().getFunction(currSelector!!,p.second, + FunctionParam.getArgTypes(readOnlyArgs), + FunctionParam.getArgTypes(normalArgs)) + } + //调用函数 + return if (func is UnknownFunction) { + //可能是构造函数 + var cls: Class? = GlobalField.getClass(p.first, p.second) + if (cls == null) { + LogProcessor.error("Function " + ctx.text + " not defined") + Function.addCommand("[Failed to Compile]${ctx.text}") + func.invoke(normalArgs,currSelector) + return func.returnVar + } + if(cls is GenericClass){ + //实例化泛型函数 + cls = cls.compile(readOnlyArgs) + } + //获取对象 + val ptr = cls.newInstance() + //调用构造函数 + val constructor = cls.getConstructor(FunctionParam.getArgTypeNames(normalArgs)) + if (constructor == null) { + LogProcessor.error("No constructor like: " + FunctionParam.getArgTypeNames(normalArgs) + " defined in class " + ctx.namespaceID().text) + Function.addCommand("[Failed to compile]${ctx.text}") + }else{ + constructor.invoke(normalArgs, callerClassP = ptr) + } + return ptr + }else{ + if(func is Generic<*>){ + func.invoke(readOnlyArgs, normalArgs, currSelector) + }else{ + func.invoke(normalArgs,currSelector) + } + //函数树 + Function.currFunction.child.add(func) + func.parent.add(Function.currFunction) + func.returnVar + } + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/McfppTypeVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/McfppTypeVisitor.kt new file mode 100644 index 00000000..20b59683 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/McfppTypeVisitor.kt @@ -0,0 +1,255 @@ +package top.mcfpp.antlr + +import top.mcfpp.Project +import top.mcfpp.io.MCFPPFile +import top.mcfpp.lang.MCAny +import top.mcfpp.lang.type.MCFPPType +import top.mcfpp.model.* +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.generic.ClassParam +import top.mcfpp.model.generic.GenericClass +import top.mcfpp.util.LazyWrapper +import top.mcfpp.util.LogProcessor +import top.mcfpp.util.StringHelper + +/** + * 解析当前项目的类型 + */ +class McfppTypeVisitor: mcfppParserBaseVisitor() { + + /** + * 遍历整个文件。一个文件包含了命名空间的声明,函数的声明,类的声明以及全局变量的声明。全局变量是可以跨文件调用的。 + * @param ctx the parse tree + * @return null + */ + override fun visitCompilationUnit(ctx: mcfppParser.CompilationUnitContext) { + Project.ctx = ctx + //命名空间 + if (ctx.namespaceDeclaration() != null) { + //获取命名空间 + var namespaceStr = ctx.namespaceDeclaration().Identifier()[0].text + if(ctx.namespaceDeclaration().Identifier().size > 1){ + ctx.namespaceDeclaration().Identifier().forEach{e -> + run { + namespaceStr += ".${e.text}" + } + } + } + Project.currNamespace = namespaceStr + }else{ + Project.currNamespace = Project.config.defaultNamespace + } + //导入库 + for (lib in ctx.importDeclaration()){ + visit(lib) + } + if(!GlobalField.localNamespaces.containsKey(Project.currNamespace)){ + GlobalField.localNamespaces[Project.currNamespace] = Namespace(Project.currNamespace) + } + //文件结构,类和函数 + for (t in ctx.typeDeclaration()) { + visit(t) + } + } + + /** + * 完成一次库的import + * TODO 类型别名 + * + * @param ctx + */ + override fun visitImportDeclaration(ctx: mcfppParser.ImportDeclarationContext) { + Project.ctx = ctx + //获取命名空间 + var namespace = ctx.Identifier(0).text + if (ctx.Identifier().size > 1) { + for (n in ctx.Identifier().subList(1, ctx.Identifier().size)) { + namespace += ".$n" + } + } + //获取库的命名空间 + val libNamespace = GlobalField.libNamespaces[namespace] + if (libNamespace == null) { + LogProcessor.error("Namespace $namespace not found") + return + } + //将库的命名空间加入到importedLibNamespaces中 + val nsp = Namespace(namespace) + GlobalField.importedLibNamespaces[namespace] = nsp + + //这个库被引用的类 + if(ctx.cls == null){ + //只导入方法 + libNamespace.field.forEachFunction { f -> + run { + nsp.field.addFunction(f,false) + } + } + return + } + //导入类和方法 + if(ctx.cls.text == "*"){ + //全部导入 + libNamespace.field.forEachClass { c -> + run { + nsp.field.addClass(c.identifier,c) + } + } + libNamespace.field.forEachFunction { f -> + run { + nsp.field.addFunction(f,false) + } + } + }else{ + //只导入声明的类 + val cls = libNamespace.field.getClass(ctx.cls.text) + if(cls != null){ + nsp.field.addClass(cls.identifier,cls) + }else{ + LogProcessor.error("Class ${ctx.cls.text} not found in namespace $namespace") + } + } + } + + /** + * 类或函数声明 + *
+     * `classOrFunctionDeclaration
+     * :   classDeclaration
+     * |   functionDeclaration
+     * |   nativeDeclaration
+     * ;`
+    
* + * @param ctx the parse tree + * @return null + */ + override fun visitDeclarations(ctx: mcfppParser.DeclarationsContext){ + Project.ctx = ctx + if (ctx.globalDeclaration() != null) return + super.visitDeclarations(ctx) + } + + override fun visitInterfaceDeclaration(ctx: mcfppParser.InterfaceDeclarationContext){ + Project.ctx = ctx + //注册类 + val id = ctx.classWithoutNamespace().text + val nsp = GlobalField.localNamespaces[Project.currNamespace]!! + if (nsp.field.hasInterface(id)) { + //重复声明 + LogProcessor.error("Interface has been defined: $id in namespace ${Project.currNamespace}") + Interface.currInterface = nsp.field.getInterface(id) + } else { + //如果没有声明过这个类 + val itf = Interface(id, Project.currNamespace) + for (p in ctx.className()){ + //是否存在继承 + val nsn = StringHelper.splitNamespaceID(p.text) + val namespace = nsn.first + val identifier = nsn.second + val pc = GlobalField.getInterface(namespace, identifier) + if(pc == null){ + LogProcessor.error("Undefined Interface: " + p.text) + }else{ + itf.parent.add(pc) + } + } + nsp.field.addInterface(id, itf) + } + } + + /** + * TODO native类的声明 + * @param ctx the parse tree + * @return null + */ + override fun visitNativeClassDeclaration(ctx: mcfppParser.NativeClassDeclarationContext){ + //NativeClassVisitor().visit(ctx) + } + + + /** + * 类的声明 + * @param ctx the parse tree + * @return null + */ + override fun visitClassDeclaration(ctx: mcfppParser.ClassDeclarationContext){ + Project.ctx = ctx + //注册类 + val id = ctx.classWithoutNamespace().text + val nsp = GlobalField.localNamespaces[Project.currNamespace]!! + + val cls = if(ctx.readOnlyParams() != null){ + //泛型类 + val qwq = GenericClass(id, Project.currNamespace, ctx.classBody()) + qwq.readOnlyParams.addAll(ctx.readOnlyParams().parameterList().parameter().map { + ClassParam(it.type().text, it.Identifier().text) + }) + qwq + } else { + //如果没有声明过这个类 + Class(id, Project.currNamespace) + } + if(!nsp.field.addClass(id, cls)){ + LogProcessor.error("Class has been defined: $id in namespace ${Project.currNamespace}") + return + } + cls.initialize() + if(ctx.className().size != 0){ + for (p in ctx.className()){ + //是否存在继承 + val qwq = StringHelper.splitNamespaceID(p.text) + val identifier: String = qwq.second + val namespace : String? = qwq.first + var pc : CompoundData? = GlobalField.getClass(namespace, identifier) + if(pc == null){ + pc = GlobalField.getInterface(namespace, identifier) + if(pc == null){ + pc = Class.Companion.UndefinedClassOrInterface(identifier,namespace) + } + } + cls.extends(pc) + } + }else{ + //继承Any类 + cls.extends(MCAny.data) + } + cls.isStaticClass = ctx.STATIC() != null + cls.isAbstract = ctx.ABSTRACT() != null + } + + /** + * + */ + override fun visitTemplateDeclaration(ctx: mcfppParser.TemplateDeclarationContext?){ + Project.ctx = ctx!! + //注册模板 + val id = ctx.classWithoutNamespace().text + val nsp = GlobalField.localNamespaces[Project.currNamespace]!! + if (nsp.field.hasTemplate(id)) { + //重复声明 + LogProcessor.error("Template has been defined: $id in namespace ${Project.currNamespace}") + Template.currTemplate = nsp.field.getTemplate(id) + } + val template = Template(id, LazyWrapper{ MCFPPType.parseFromIdentifier(ctx.type().text, MCFPPFile.currFile!!.field)}, Project.currNamespace) + if (ctx.className() != null) { + //是否存在继承 + val qwq = ctx.className().text.split(":") + val identifier: String + val namespace : String? + if(qwq.size == 1){ + identifier = qwq[0] + namespace = null + }else{ + namespace = qwq[0] + identifier = qwq[1] + } + val s = GlobalField.getTemplate(namespace, identifier) + if(s == null){ + LogProcessor.error("Undefined template: " + ctx.className().text) + }else{ + template.parent.add(s) + } + } + nsp.field.addTemplate(id, template) + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/antlr/NativeClassVisitor.kt b/src/main/kotlin/top/mcfpp/antlr/NativeClassVisitor.kt new file mode 100644 index 00000000..96b39046 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/antlr/NativeClassVisitor.kt @@ -0,0 +1,78 @@ +package top.mcfpp.antlr + +/** + * 遍历一个Native类,并将其和java方法对应 + * + * @constructor Create empty Native class visitor + */ +class NativeClassVisitor: mcfppParserBaseVisitor() { + + /* + @Override + override fun visitNativeClassDeclaration(ctx: mcfppParser.NativeClassDeclarationContext?): Any? { + Project.ctx = ctx + //注册类 + val identifier: String = ctx!!.classWithoutNamespace().text + if (GlobalField.localNamespaces[Project.currNamespace]!!.hasClass(identifier)) { + //重复声明 + LogProcessor.error("Already defined class: $identifier") + throw ClassDuplicationException() + } else { + //获取它指向的java类 + val cls: java.lang.Class = try { + java.lang.Class.forName(ctx.javaRefer().text) as java.lang.Class + } catch (e: ClassNotFoundException) { + throw RuntimeException(e) + } catch (e: ClassCastException) { + throw RuntimeException(e) + } + val ncls = NativeClass(identifier, cls) + GlobalField.localNamespaces[Project.currNamespace]!!.addClass(identifier, ncls) + Class.currClass = ncls + if(ctx.nativeClassBody() != null){ + visit(ctx.nativeClassBody()) + } + Class.currClass = null + } + return null + } + + @Override + override fun visitNativeClassBody(ctx: mcfppParser.NativeClassBodyContext?): Any? { + ctx!! + for (i in ctx.nativeClassFunctionDeclaration()) { + val nf = visit(i) as NativeFunction? + if(nf != null){ + Class.currClass!!.staticField.addFunction(nf,false) + } + } + return null + } + + @Override + override fun visitNativeClassFunctionDeclaration(ctx: mcfppParser.NativeClassFunctionDeclarationContext?): Any? { + //accessModifier? NATIVE 'func' Identifier '(' parameterList? ')' ';' + ctx!! + val accessModifier: Member.AccessModifier = if (ctx.accessModifier() != null) { + Member.AccessModifier.valueOf(ctx.accessModifier().text.lowercase()) + } else { + Member.AccessModifier.PUBLIC + } + //获取这个java方法 + val javaMethod : Method + try{ + val cls: java.lang.Class<*> = (Class.currClass as NativeClass).cls + javaMethod = cls.getMethod(ctx.Identifier().text , Array::class.java, ClassPointer::class.java) + } catch (e: NoSuchMethodException) { + LogProcessor.error("No such method:" + ctx.Identifier().text) + return null + } + val nf = NativeFunction(ctx.Identifier().text, javaMethod) + nf.accessModifier = accessModifier + if (ctx.parameterList() != null) { + nf.addParams(ctx.parameterList()) + } + return nf + } + */ +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/command/Command.kt b/src/main/kotlin/top/mcfpp/command/Command.kt new file mode 100644 index 00000000..71f2aff0 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/command/Command.kt @@ -0,0 +1,180 @@ +package top.mcfpp.command + +import top.mcfpp.exception.CommandException +import java.lang.StringBuilder + +/** + * 一条编译时动态命令。包含了可以被替换的字符串位点,每个位点都有一个唯一的ID。 + * + * @constructor Create empty Command + */ +open class Command { + + protected val commandStringList = ArrayList() + + private val tags = ArrayList() + + private val replacePoint = HashMap() + + var isCompleted = false + + constructor(command: String){ + commandStringList.add(command) + } + + constructor(command: String, pointID: String){ + replacePoint[pointID] = commandStringList.size + commandStringList.add(command) + } + + /** + * 这个动态命令是否拥有指定的tag + * + * @param tag 目标tag + * @return 是否有这个tag + */ + fun hasTag(tag: String): Boolean{ + return tags.contains(tag) + } + + /** + * 将这个动态命令解析为字符串 + * + * @return + */ + open fun analyze(): String{ + val sb = StringBuilder() + for (c in commandStringList){ + sb.append(c) + } + commandStringList.clear() + commandStringList.add(sb.toString()) + replacePoint.clear() + return sb.toString() + } + + /** + * 转为宏命令。将会把所有可以替换的位点设置为宏参数。宏参数的名字和替换位点id相同 + */ + fun toMacro() : String{ + val sb = StringBuilder() + for (c in commandStringList.indices){ + if(replacePoint.containsValue(c)){ + sb.append("{{${replacePoint.filter { it.value == c }.keys.first()}}}") + }else{ + sb.append(commandStringList[c]) + } + } + return sb.toString() + } + + /** + * 替换目标位点中的字符串 + * + * @param pointID 位点的ID + * @param target 目标字符串 + * + * @return 如果没有可以替换的位点,则返回false + */ + private fun replace(pointID: String, target: String): Boolean{ + val point = replacePoint[pointID] ?: return false + commandStringList[point] = target + return true + } + + fun replace(vararg pointIDtoTarget: Pair): Int{ + var suc = 0 + for (pt in pointIDtoTarget){ + if(replace(pt.first,pt.second)) suc++ + } + return suc + } + + fun get(pointID: String): String?{ + val point = replacePoint[pointID] ?: return null + return commandStringList[point] + } + + fun prepend(command: String){ + if(isCompleted){ + throw CommandException("Try to prepend argument to a completed command") + } + commandStringList.add(0,command) + } + + fun prepend(command: Command){ + if(isCompleted){ + throw CommandException("Try to prepend argument to a completed command") + } + for (c in command.commandStringList){ + commandStringList.add(0,c) + } + replacePoint.putAll(command.replacePoint) + } + + /** + * 在这条命令的末尾继续构建命令 + * + * @param command 固定的命令字符串 + * @param withBlank 是否会在此字符串和已有的字符串之间添加空格 + * @return + */ + fun build(command: String) : Command{ + commandStringList.add(command) + return this + } + + fun build(command: Command): Command{ + for (kv in command.replacePoint){ + replacePoint[kv.key] = kv.value + commandStringList.size + } + commandStringList.addAll(command.commandStringList) + return this + } + + /** + * 在这条命令的末尾继续构建命令 + * + * @param command 可被替换的命令字符串 + * @param pointID 命令字符串的位点ID + * @return + */ + fun build(command: String, pointID: String) : Command{ + replacePoint[pointID] = commandStringList.size + commandStringList.add(" ") + commandStringList.add(command) + return this + } + + override fun toString(): String{ + val sb = StringBuilder() + for (c in commandStringList){ + sb.append(c) + } + return sb.toString() + } + + companion object{ + + /** + * 构建命令 + * + * @param command 固定的命令字符串 + * @return + */ + fun build(command: String) : Command{ + return Command(command) + } + + /** + * 构建命令 + * + * @param command 可被替换的命令字符串 + * @param pointID 命令字符串的位点ID + * @return + */ + fun build(command: String, pointID: String) : Command{ + return Command(command, pointID) + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/command/CommandList.kt b/src/main/kotlin/top/mcfpp/command/CommandList.kt new file mode 100644 index 00000000..4e3f7c25 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/command/CommandList.kt @@ -0,0 +1,37 @@ +package top.mcfpp.command + +import top.mcfpp.Project + +class CommandList : ArrayList() { + fun analyzeAll(): ArrayList{ + val re = ArrayList() + for (c in this){ + if(c is Comment && c.type < Project.config.commentLevel) continue + re.add(c.analyze()) + } + return re + } + + fun replaceAll(vararg pointIDtoTarget: Pair){ + for (c in this){ + c.replace(*pointIDtoTarget) + } + } + + fun replaceThenAnalyze(vararg pointIDtoTarget: Pair){ + for (c in this){ + if(c.replace(*pointIDtoTarget) != 0){ + c.analyze() + } + } + } + + fun add(element: String): Boolean { + return super.add(Command.build(element)) + } + + fun add(index: Int, element: String){ + return super.add(index, Command.build(element)) + } + +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/command/Commands.kt b/src/main/kotlin/top/mcfpp/command/Commands.kt new file mode 100644 index 00000000..772abf9c --- /dev/null +++ b/src/main/kotlin/top/mcfpp/command/Commands.kt @@ -0,0 +1,123 @@ +package top.mcfpp.command + +import top.mcfpp.Project +import top.mcfpp.lang.* +import top.mcfpp.lang.type.MCFPPClassType +import top.mcfpp.model.function.Function + +/** + * 命令总类,提供了大量用于生成命令的方法。默认提供了一些可替换的位点 + */ +object Commands { + + /** + * function + * + * @param function + * @return + */ + fun function(function: Function): Command { + return Command.build("function").build(function.namespaceID,function.namespaceID) + } + + + /** + * scoreboard players get + * + * @param target + * @return + */ + fun sbPlayerGet(target: MCInt): Command{ + return Command.build("scoreboard players get") + .build(target.name,target.name) + .build(target.`object`.toString(),target.`object`.toString()) + } + + /** + * scoreboard players add value + * + * @param target + * @param value + * @return + */ + fun sbPlayerAdd(target: MCInt, value: Int): Command { + return Command.build("scoreboard players add") + .build(target.name, target.name) + .build(target.`object`.toString(), target.`object`.toString()) + .build(" $value") + } + + /** + * scoreboard players operation + * + * @param a + * @param operation + * @param b + * @return + */ + fun sbPlayerOperation(a: MCInt, operation: String, b: MCInt): Command { + return Command.build("scoreboard players operation") + .build(a.name,a.name) + .build(a.`object`.toString(),a.`object`.toString()) + .build(operation,"operation") + .build(b.name,b.name) + .build(b.`object`.toString(),b.`object`.toString()) + } + + /** + * scoreboard players remove value + * + * @param target + * @param value + * @return + */ + fun sbPlayerRemove(target: MCInt, value: Int): Command { + return Command.build("scoreboard players remove ") + .build(target.name, target.name) + .build(target.`object`.toString(), target.`object`.toString()) + .build(value.toString()) + } + + fun sbPlayerSet(a: MCInt, value: Int): Command { + return Command.build("scoreboard players set ") + .build(a.name,a.name) + .build(a.`object`.toString(),a.`object`.toString()) + .build(value.toString()) + } + + fun selectRun(a : CanSelectMember, command: Command) : Array{ + val final = when(a){ + is ClassPointer -> { + arrayOf( + Command.build("data modify storage entity ${ClassPointer.tempItemEntityUUID} Thrower set from storage mcfpp:system ${Project.config.defaultNamespace}.stack_frame[${a.stackIndex}].${a.identifier}"), + Command.build("execute as ${ClassPointer.tempItemEntityUUID} on origin").build("run","run").build(command) + ) + } + is MCFPPClassType -> { + arrayOf(Command.build("execute as ${a.cls.uuid} run").build(command)) + } + else -> TODO() + } + return final + } + + fun selectRun(a : CanSelectMember) : Array{ + val final = when(a){ + is ClassPointer -> { + arrayOf( + Command.build("data modify storage entity ${ClassPointer.tempItemEntityUUID} Thrower set from storage mcfpp:system ${Project.config.defaultNamespace}.stack_frame[${a.stackIndex}].${a.identifier}"), + Command.build("execute as ${ClassPointer.tempItemEntityUUID} on origin").build("run","run") + ) + } + is MCFPPClassType -> { + arrayOf(Command.build("execute as ${a.cls.uuid}").build("run","run")) + } + else -> TODO() + } + return final + } + + fun selectRun(a : CanSelectMember, command: String) : Array{ + return selectRun(a, Command.build(command)) + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/command/Comment.kt b/src/main/kotlin/top/mcfpp/command/Comment.kt new file mode 100644 index 00000000..fb4bf009 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/command/Comment.kt @@ -0,0 +1,24 @@ +package top.mcfpp.command + +class Comment : Command { + + val type : CommentType + + constructor(comment: String, commentType: CommentType = CommentType.INFO):super(comment){ + isCompleted = true + this.type = commentType + } + + override fun analyze(): String { + return this.commandStringList[0] + } + + override fun toString(): String { + return this.commandStringList[0] + } + +} + +enum class CommentType{ + DEBUG, INFO, WARN, ERROR +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/command/package-info.kt b/src/main/kotlin/top/mcfpp/command/package-info.kt new file mode 100644 index 00000000..2a147025 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/command/package-info.kt @@ -0,0 +1,7 @@ +/** + * 命令部分。 + * 本意是将命令输出全部转换为方法调用,从而避免过多的字符串操作,但是现在看来,似乎直接写字符串反而更简单。 + * 仅仅保留了少部分使用次数过多难以更改的函数。其余函数已被删除 + */ +package top.mcfpp.command + diff --git a/src/main/kotlin/top/mcfpp/command/tree/CommandTreeModel.kt b/src/main/kotlin/top/mcfpp/command/tree/CommandTreeModel.kt new file mode 100644 index 00000000..68ca1f6b --- /dev/null +++ b/src/main/kotlin/top/mcfpp/command/tree/CommandTreeModel.kt @@ -0,0 +1,40 @@ +package top.mcfpp.command.tree + + +enum class TreeNodeType{ + argument,literal,root +} + +class CommandTreeNode{ + var type: TreeNodeType=TreeNodeType.root + var children: MutableMap?=null + var executable: Boolean?=null + var redirect: List?=null + var parser: String?=null + var properties: MutableMap?=null +} + +/* +interface BaseTreeNode{ + var type:TreeNodeType + var children:MutableMap? + var executable:Boolean? + var redirect:List? +} +interface ArgumentTreeNode:BaseTreeNode{ + //type = argument + var parser: String + var properties:MutableMap? +} + +interface LiteralTreeNode:BaseTreeNode{ + //type = literal +} + +interface RootTreeNode:BaseTreeNode{ + //type = root + override var children: MutableMap? + //MutableMap +} + + */ \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/command/tree/DownloadHelper.kt b/src/main/kotlin/top/mcfpp/command/tree/DownloadHelper.kt new file mode 100644 index 00000000..a7b5ccbb --- /dev/null +++ b/src/main/kotlin/top/mcfpp/command/tree/DownloadHelper.kt @@ -0,0 +1,342 @@ +package top.mcfpp.command.tree + +import com.alibaba.fastjson2.JSON +import com.alibaba.fastjson2.JSONArray +import top.mcfpp.Project +import top.mcfpp.util.LogProcessor +import java.io.FileNotFoundException +import java.io.IOException +import java.net.URL +import java.nio.file.Files +import java.nio.file.Path +import java.util.* +import java.util.zip.GZIPInputStream + +/** + * @author SPGoding, XiLaiTL + * @see (https://github.com/SpyglassMC/Spyglass.git) Downloader + */ + +/* +MIT License + +Copyright (c) 2019-2022 SPGoding + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + */ + +fun parseGzippedJson(buffer: ByteArray): Any? { + GZIPInputStream(buffer.inputStream()).use { + return JSON.parse(it.readAllBytes()) + } +} + +enum class DownloadResourceType{ + blocks,commands,registries +} + +class DownloadHelper { + companion object{ + private fun getUri( + source:String, + user:String, + repo:String, + tag:String, + path:String + ): String = when(source){ + "fastly"-> "https://fastly.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}" + "github"-> "https://raw.githubusercontent.com/${user}/${repo}/${tag}/${path}" + "jsdelivr"-> "https://cdn.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}" + else -> "" + } + + private fun getMcmetaSummaryUri( + type:DownloadResourceType, + version: String, + isLatest: Boolean, + source: String, + ):String{ + val tag = if(isLatest) "summary" else "${version}-summary" + val path = "${type}/data.json.gz" + val res = getUri( + source.lowercase(Locale.getDefault()), + user = "misode", repo = "mcmeta",tag, path) + return res + } + private fun getMcmetaSummary( + type: DownloadResourceType, + version: String, + isLatest: Boolean, + source: String, + ):Any? // JSON + { + val ref = Downloader.getGitRef( + defaultBranch = "summary", + getTag = { "${it}-summary"}, + isLatest, + version + ) + val uri = getMcmetaSummaryUri(type,version,isLatest,source) + var checksum:String? = null + fun getResource(type:DownloadResourceType):Any?{ + val out = Downloader.DownloadOut(null, null) + val data = Downloader.download( + Downloader.DownloadJob( + id = "mc-je/${version}/${type}.json.gz", + uri, + transformer = { + parseGzippedJson(it) + }, + cache = Downloader.DownloadCache.getCacheOptionsBasedOnGitHubCommitSha("misode", "mcmeta", ref), + ttl = Downloader.DownloaderTtl, + options = null + ), out + ) + checksum = if(checksum==null ) out.checksum else checksum + return data + } + return getResource(DownloadResourceType.commands) + } + fun getMcmetaCommands( + version: String, + isLatest: Boolean, + source: String, + ):CommandTreeNode{ + return JSON.to(CommandTreeNode::class.java, getMcmetaSummary(DownloadResourceType.commands,version,isLatest,source)) + } + } +} + + +class Downloader(){ + class ExternalDownloaderOptions( + val headers: MutableMap?, + val timeout: Int? + ){} + + + class DownloadJob( + val id: String?, + val uri: String,//"http://" "https://" + val cache: DownloadCache?, + val transformer:(data: ByteArray)->R, + val options: ExternalDownloaderOptions?, + val ttl: Int? + ){ + constructor(job: DownloadJob,id:String) : this( + id,job.uri,job.cache,job.transformer,job.options,job.ttl + ) {} + } + + class MemoryCache( + var buffer: ByteArray, + var time:Long + ){} + class DownloadCache( + val checksumJob: DownloadJob, + val checksumExtension: String, //".${extension}" + val serializer: ((data: ByteArray)->ByteArray)?, + val deserializer: ((data: ByteArray)->ByteArray)? + ){ + class GitHubRefResponse( + var message: String?, + var ref: String, + var `object`:ShaObject + ){ + class ShaObject(var sha:String) + } + companion object{ + fun getCacheOptionsBasedOnGitHubCommitSha( + owner: String, + repo: String, + ref: String, + ):DownloadCache { + return DownloadCache( + checksumExtension = ".commit-sha", + checksumJob = DownloadJob( + uri = "https://api.github.com/repos/${owner}/${repo}/git/${ref}", + transformer = Downloader::getGitHubRefResponseSha, + options = GitHubApiDownloadOptions, + ttl = DownloaderTtl, + id = null, + cache = null + ), + deserializer = null, + serializer = null + ) + } + } + } + + class DownloadOut( + var cacheUri: Path?, + var checksum: String? + ) {} + companion object{ + val DownloaderTtl = 15_000 + val GitHubApiDownloadOptions = ExternalDownloaderOptions( + headers = mutableMapOf( + "Accept" to "application/vnd.github.v3+json", + "User-Agent" to "XiLaiTL" + ), + null + ) + fun getGitHubRefResponseSha(buffer:ByteArray):String{ + val response = JSON.parse(buffer) + if(response is JSONArray){ + val gitHubRefResponse = JSON.to(DownloadCache.GitHubRefResponse::class.java,response[0]) + return gitHubRefResponse.`object`.sha; + } + val gitHubRefResponse = JSON.to(DownloadCache.GitHubRefResponse::class.java,response) + if(gitHubRefResponse.message==null){ + return gitHubRefResponse.`object`.sha; + } + else{ + throw Error(gitHubRefResponse.message) + } + } + fun getGitRef( + defaultBranch: String, + getTag: (version: String) -> String, + isLatest: Boolean, + version: String + ):String{ + return if(isLatest) "refs/heads/${defaultBranch}" + else "refs/tags/${getTag(version)}" + } + + val memoryCaches:MutableMap = mutableMapOf() + fun download( + job: DownloadJob, + out: DownloadOut = DownloadOut(null,null) + ): R? { + if(job.ttl!=null&& memoryCaches.contains(job.uri)){ + val memoryCache = memoryCaches[job.uri]!! + if(memoryCache.time <= System.currentTimeMillis()+ job.ttl){ + LogProcessor.info( + "[Downloader] [${job.id}] Skipped thanks to valid cache in memory", + ) + return job.transformer(memoryCache.buffer) + } + else{ + memoryCaches.remove(job.uri) + } + + } + var checksum:String? = null + var cacheUri:Path? = null + var cacheChecksumUri: Path? = null + if(job.cache!=null){ + var checksumJob = job.cache.checksumJob + var checksumExtension = job.cache.checksumExtension + cacheUri = Project.config.root.resolve("downloader/${job.id}") + out.cacheUri = cacheUri + cacheChecksumUri = Project.config.root.resolve("downloader/${job.id}${checksumExtension}") + try{ + if(Files.notExists(cacheUri.parent)){ + Files.createDirectories(cacheUri.parent) + } + if(Files.notExists(cacheChecksumUri.parent)){ + Files.createDirectories(cacheChecksumUri.parent) + } + } + catch (_:IOException){ } + + try{ + checksum = download(DownloadJob(checksumJob,job.id+checksumExtension)) + out.checksum = checksum + try{ + val cacheChecksum = Files.readString(cacheChecksumUri) + if(checksum == cacheChecksum){ + try { + if(cacheUri!=null){ + val cachedBuffer = Files.readAllBytes(cacheUri) + if(job.ttl!=null){ + memoryCaches[job.uri] = MemoryCache(cachedBuffer,System.currentTimeMillis()) + val deserializer = job.cache.deserializer?:{it} + LogProcessor.info("[Downloader] [${job.id}] Skipped downloading thanks to cache ${cacheChecksum}",) + return job.transformer(deserializer(cachedBuffer)) + } + } + } + catch (_:FileNotFoundException){ + try{ + if(cacheChecksumUri!=null) + Files.delete(cacheChecksumUri) + } + catch (_:IOException){ + LogProcessor.error("[Downloader] [${job.id}] Removing invalid cache checksum “${cacheChecksumUri}") + } + } + catch (_:IOException){ + LogProcessor.error("[Downloader] [${job.id}] Loading cached file “${cacheUri}") + } + } + } + catch (_:FileNotFoundException){ } + catch (_:IOException){ + LogProcessor.error("[Downloader] [${job.id}] Loading cache checksum “${cacheChecksumUri}”",) + } + } + catch (_:IOException){ + LogProcessor.error("[Downloader] [${job.id}] Fetching latest checksum “${checksumJob.uri}”",) + } + } + + try{ + URL(job.uri).openStream().use {input-> + val buffer = input.readAllBytes() + if(job.ttl!=null){ + memoryCaches[job.uri] = MemoryCache(buffer,System.currentTimeMillis()) + } + if(job.cache!=null&&cacheUri!=null&&cacheChecksumUri!=null){ + if(checksum!=null){ + try{ + Files.writeString(cacheChecksumUri,checksum) + } + catch (_:IOException){ + LogProcessor.error("[Downloader] [${job.id}] Saving cache checksum “${cacheChecksumUri}") + } + } + try{ + val serializer = job.cache.serializer?:{it} + Files.write(cacheUri,serializer(buffer)) + } + catch (_:IOException){ + LogProcessor.error("[Downloader] [${job.id}] Caching file “${cacheUri}") + } + } + LogProcessor.info("[Downloader] [${job.id}] Downloaded from “${job.uri}”") + return job.transformer(buffer) + } + + } + catch (_:IOException){ + LogProcessor.error("[Downloader] [${job.id}] Downloading “${job.uri}”") + } + return null + } + + } + +} + + diff --git a/src/main/kotlin/top/mcfpp/commandline/LineCompiler.kt b/src/main/kotlin/top/mcfpp/commandline/LineCompiler.kt new file mode 100644 index 00000000..e1e9fbd5 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/commandline/LineCompiler.kt @@ -0,0 +1,69 @@ +package top.mcfpp.commandline + +import org.antlr.v4.runtime.CharStream +import org.antlr.v4.runtime.CharStreams +import org.antlr.v4.runtime.CommonTokenStream +import top.mcfpp.antlr.McfppFieldVisitor +import top.mcfpp.antlr.McfppImVisitor +import top.mcfpp.antlr.mcfppLexer +import top.mcfpp.antlr.mcfppParser +import top.mcfpp.io.MCFPPFile +import top.mcfpp.model.function.Function + +class LineCompiler { + + val COMMAND_COLOR = "\u001b[38;5;7m" + val OUTPUT_COLOR = "\u001B[38;5;15m" + val RESET_COLOR = "\u001B[0m" + + val default = Function("default","mcfpp") + val defaultFile = MCFPPFile("default") + + var unmatchedBraces : String = "" + var leftBraces = 0 + + fun compile(line: String) { + //处理未匹配的括号 + for (char in line) { + when (char) { + '{' -> leftBraces++ + '}' -> { + if (leftBraces == 0) { + throw Exception("Unmatched right brace") + } + leftBraces-- + } + } + } + if (leftBraces > 0) { + unmatchedBraces += line + return + } + leftBraces = 0 + val input = unmatchedBraces + line + unmatchedBraces = "" + Function.currFunction = default + MCFPPFile.currFile = defaultFile + val charStream: CharStream = CharStreams.fromString(input + if(!line.endsWith(';')) ";" else "") + val tokens = CommonTokenStream(mcfppLexer(charStream)) + val unit = mcfppParser(tokens).compilationUnit() + if(unit.topStatement().statement().size != 0){ + McfppImVisitor().visit(unit) + }else{ + McfppFieldVisitor().visit(unit) + } + for (i in MCFPPFile.currFile!!.topFunction.commands){ + printOutput(i.toString()) + } + MCFPPFile.currFile!!.topFunction.commands.clear() + Function.currFunction = Function.nullFunction + } + + private fun printCommand(string: String){ + println(COMMAND_COLOR + string + RESET_COLOR) + } + + private fun printOutput(string: String){ + println(OUTPUT_COLOR + string + RESET_COLOR) + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/commandline/Main.kt b/src/main/kotlin/top/mcfpp/commandline/Main.kt new file mode 100644 index 00000000..6ff05da7 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/commandline/Main.kt @@ -0,0 +1,82 @@ +package top.mcfpp.commandline + +import org.apache.logging.log4j.core.config.ConfigurationSource +import org.apache.logging.log4j.core.config.Configurator +import top.mcfpp.MCFPP +import top.mcfpp.Project +import top.mcfpp.io.lib.LibReader +import top.mcfpp.lang.UnresolvedVar +import top.mcfpp.model.field.GlobalField +import top.mcfpp.util.UwU +import java.io.FileInputStream +import java.time.Instant + +fun main(){ + val source: ConfigurationSource + try { + source = ConfigurationSource(FileInputStream("log4j2.xml")) + Configurator.initialize(null,source) + }catch (e:Exception){ + println("Failed to load log4j2.xml") + } + //导入基础库 + for (include in Project.config.stdLib) { + LibReader.read(include) + } + for(namespace in GlobalField.libNamespaces.values){ + namespace.field.forEachClass { c -> + run { + for (v in c.field.allVars){ + if(v is UnresolvedVar){ + c.field.putVar(c.identifier, v, true) + } + } + for (v in c.staticField.allVars){ + if(v is UnresolvedVar){ + c.staticField.putVar(c.identifier, v, true) + } + } + } + } + } + GlobalField.init() + GlobalField.importedLibNamespaces["mcfpp.sys"] = GlobalField.libNamespaces["mcfpp.sys"] + println("MCFPP ${MCFPP.version} (${Instant.now()})") + println("Tips: " + UwU.tip) //生成tips + val compiler = LineCompiler() + //等待输入 + while(true){ + if(compiler.leftBraces == 0){ + print(">") + } + when(val line = readln()){ + "help" -> printHelp() + "exit" -> return + "version" -> println("MCFPP ${MCFPP.version}") + else -> { + try { + compiler.compile(line) + }catch (e:Exception){ + e.printStackTrace() + //throw e + } + } + } + + } +} + +fun printHelp() { + val helpMessage = """ + Welcome to MCFPP ${MCFPP.version}'s help utility! If this is your first time using + MCFPP, you should definitely check out the documentation at + https://www.mcfpp.top/. + + Enter any valid MCFPP code to execute in this interactive shell. + + To display version details, enter "version". + + To quit the shell, enter "quit". + """.trimIndent() + println(helpMessage) +} diff --git a/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunction.kt b/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunction.kt new file mode 100644 index 00000000..5f3a069d --- /dev/null +++ b/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunction.kt @@ -0,0 +1,41 @@ +package top.mcfpp.compiletime + +import top.mcfpp.antlr.mcfppParser +import top.mcfpp.lang.ClassPointer +import top.mcfpp.lang.Var +import top.mcfpp.lang.type.MCFPPType +import top.mcfpp.model.function.Function +import top.mcfpp.model.field.IField +import kotlin.collections.ArrayList + +class CompileTimeFunction : Function { + var context: mcfppParser.FunctionBodyContext + constructor(name:String, namespace:String, returnType: MCFPPType, context:mcfppParser.FunctionBodyContext):super(name,namespace,returnType){ + this.context=context + } + + fun setField(parent: IField){ + this.field = CompileTimeFunctionField(parent,this) + } + + private fun makeField():CompileTimeFunctionField{ + return (this.field as CompileTimeFunctionField).clone() + } + private fun argPass(field:CompileTimeFunctionField, /*readOnlyArgs: ArrayList>, */normalArgs: ArrayList>) { + for (argi in normalArgs.withIndex()){ + field.putVar(normalParams[argi.index].identifier,argi.value,true) + } + /* + for (argi in readOnlyArgs.withIndex()){ + field.putVar(readOnlyParams[argi.index].identifier,argi.value,true) + } + */ + } + + override fun invoke(/*readOnlyArgs: ArrayList>, */normalArgs: ArrayList>, callerClassP: ClassPointer?) { + val field = makeField() + argPass(field, /*readOnlyArgs, */normalArgs) + val visitor = McfppCompileTimeVisitor(field) + visitor.visit(this.context) + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunctionField.kt b/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunctionField.kt new file mode 100644 index 00000000..c707b34b --- /dev/null +++ b/src/main/kotlin/top/mcfpp/compiletime/CompileTimeFunctionField.kt @@ -0,0 +1,29 @@ +package top.mcfpp.compiletime + +import top.mcfpp.lang.Var +import top.mcfpp.model.FieldContainer +import top.mcfpp.model.field.FunctionField +import top.mcfpp.model.field.IField + +class CompileTimeFunctionField(parent: IField?, cacheContainer: FieldContainer?): FunctionField(parent,cacheContainer) { + override fun clone(): CompileTimeFunctionField { + return clone(this) + } + + companion object{ + /** + * 复制一个域。 + * @param functionField 原来的域 + */ + fun clone(functionField: CompileTimeFunctionField): CompileTimeFunctionField { + val newFunctionField = CompileTimeFunctionField(functionField.parent,null) + //变量复制 + for (key in functionField.vars.keys) { + val `var`: Var<*>? = functionField.vars[key] + newFunctionField.vars[key] = `var`!!.clone() + } + newFunctionField.fieldVarSet.addAll(functionField.fieldVarSet) + return newFunctionField + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/compiletime/JavaScriptInterpreter.kt b/src/main/kotlin/top/mcfpp/compiletime/JavaScriptInterpreter.kt new file mode 100644 index 00000000..3ffb90e2 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/compiletime/JavaScriptInterpreter.kt @@ -0,0 +1,14 @@ +package top.mcfpp.compiletime + +import javax.script.ScriptEngine +import javax.script.ScriptEngineManager + +class JavaScriptInterpreter { + companion object{ + val engine: ScriptEngine = ScriptEngineManager().getEngineByName("nashorn"); + fun eval(str:String){ + engine.eval(str); + } + } + +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/compiletime/MCControl.kt b/src/main/kotlin/top/mcfpp/compiletime/MCControl.kt new file mode 100644 index 00000000..4136cf98 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/compiletime/MCControl.kt @@ -0,0 +1,6 @@ +package top.mcfpp.compiletime + +sealed class MCControl { + object Break:MCControl(); + object Continue:MCControl(); +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/compiletime/McfppCompileTimeVisitor.kt b/src/main/kotlin/top/mcfpp/compiletime/McfppCompileTimeVisitor.kt new file mode 100644 index 00000000..1c2f0fc4 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/compiletime/McfppCompileTimeVisitor.kt @@ -0,0 +1,197 @@ +package top.mcfpp.compiletime + +import top.mcfpp.antlr.McfppExprVisitor +import top.mcfpp.antlr.McfppImVisitor +import top.mcfpp.antlr.mcfppParser +import top.mcfpp.lang.MCBool +import top.mcfpp.lang.MCBoolConcrete +import top.mcfpp.lang.Var +import top.mcfpp.model.function.Function + +class McfppCompileTimeVisitor( + var field:CompileTimeFunctionField, +): McfppImVisitor() { + val exprVisitor = McfppExprVisitor() + + var curBreak = false; + var curContinue = false; + var curReturn = false; + var returnValue:Var<*>? = null; + + override fun visitFunctionBody(ctx: mcfppParser.FunctionBodyContext): Any? { + Function.forcedField = field + for(statement in ctx.statement()) { + if(!curReturn){ + visit(statement) + } + } + Function.forcedField = null + return null + } + override fun visitFieldDeclaration(ctx: mcfppParser.FieldDeclarationContext): Any? { + return super.visitFieldDeclaration(ctx) + } + + override fun visitStatementExpression(ctx: mcfppParser.StatementExpressionContext): Any? { + return super.visitStatementExpression(ctx) + } + + override fun visitIfStatement(ctx: mcfppParser.IfStatementContext): Any? { + val condtion= exprVisitor.visit(ctx.expression()) + if(condtion is MCBoolConcrete && condtion.value){ + visit(ctx.ifBlock()) + } + else{ + var elseIfBool = false + for(elseIfStatementContext in ctx.elseIfStatement()){ + val elseIfCondition = exprVisitor.visit(elseIfStatementContext.expression()) + if(elseIfCondition is MCBoolConcrete && elseIfCondition.value){ + visit(elseIfStatementContext.ifBlock()) + elseIfBool = true + break + } + } + if(!elseIfBool&&ctx.elseStatement()!=null){ + visit(ctx.elseStatement().ifBlock()) + } + } + return null + } + + override fun visitIfBlock(ctx: mcfppParser.IfBlockContext): Any? { + return super.visitBlock(ctx.block()) + } + + override fun visitForStatement(ctx: mcfppParser.ForStatementContext): Any? { + val forControlContext = ctx.forControl() + visit(forControlContext.forInit()) + while(true){ + val condition = exprVisitor.visit(forControlContext.expression()) + if(condition is MCBoolConcrete && condition.value){ + visit(ctx.forBlock()) + if(curBreak||curReturn){ + curBreak = false + break + } + else if(curContinue){ + curContinue = false + } + visit(forControlContext.forUpdate()) + } + else{ + return null + } + } + return null + } + + override fun visitForInit(ctx: mcfppParser.ForInitContext): Any? { + visitChildren(ctx) + return null + } + + override fun visitForUpdate(ctx: mcfppParser.ForUpdateContext): Any? { + for(statementExpression in ctx.statementExpression()){ + visit(statementExpression) + } + return null + } + + override fun visitForBlock(ctx: mcfppParser.ForBlockContext): Any? { + return visitBlock(ctx.block()) + } + + + override fun visitReturnStatement(ctx: mcfppParser.ReturnStatementContext): Any? { + curReturn = true + returnValue = exprVisitor.visit(ctx.expression()) + return null + } + + + + override fun visitWhileStatement(ctx: mcfppParser.WhileStatementContext): Any? { + while(true){ + val condition = exprVisitor.visit(ctx.expression()) + if(condition is MCBoolConcrete && condition.value){ + visit(ctx.whileBlock()) + if(curBreak||curReturn){ + curBreak = false + break + } + else if(curContinue){ + curContinue = false + } + } + else{ + return null + } + } + return null + } + override fun visitWhileBlock(ctx: mcfppParser.WhileBlockContext): Any? { + return visitBlock(ctx.block()) + } + + override fun visitDoWhileStatement(ctx: mcfppParser.DoWhileStatementContext): Any? { + visit(ctx.doWhileBlock()) + if(!curBreak||!curReturn||!curContinue){ + while(true){ + val condition = exprVisitor.visit(ctx.expression()) + if(condition is MCBoolConcrete && condition.value){ + visit(ctx.doWhileBlock()) + if(curBreak||curReturn){ + curBreak = false + break + } + else if(curContinue){ + curContinue = false + } + } + else{ + return null + } + } + } + return null + } + + override fun visitDoWhileBlock(ctx: mcfppParser.DoWhileBlockContext): Any? { + return visitBlock(ctx.block()) + } + + + override fun visitControlStatement(ctx: mcfppParser.ControlStatementContext): Any? { + if(ctx.CONTINUE()!=null){ + curContinue = true + return null + } + if(ctx.BREAK()!=null) { + curBreak = true + return null + } + return null + } + + override fun visitOrgCommand(ctx: mcfppParser.OrgCommandContext): Any? { + return super.visitOrgCommand(ctx) + } + + override fun visitSelfAddOrMinusStatement(ctx: mcfppParser.SelfAddOrMinusStatementContext): Any? { + return super.visitSelfAddOrMinusStatement(ctx) + } + + override fun visitTryStoreStatement(ctx: mcfppParser.TryStoreStatementContext): Any? { + return super.visitTryStoreStatement(ctx) + } + + override fun visitBlock(ctx: mcfppParser.BlockContext): Any? { + for(statement in ctx.statement()){ + if(curBreak||curContinue||curReturn){ + break + } + visit(statement) + } + return null + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/exception/CommandException.kt b/src/main/kotlin/top/mcfpp/exception/CommandException.kt new file mode 100644 index 00000000..65869085 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/exception/CommandException.kt @@ -0,0 +1,4 @@ +package top.mcfpp.exception + +class CommandException(msg: String) : RuntimeException(msg) { +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/exception/IllegalFormatException.kt b/src/main/kotlin/top/mcfpp/exception/IllegalFormatException.kt new file mode 100644 index 00000000..11421908 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/exception/IllegalFormatException.kt @@ -0,0 +1,5 @@ +package top.mcfpp.exception + +class IllegalFormatException(javaMethod: String) : RuntimeException(javaMethod) { + +} diff --git a/src/main/kotlin/top/mcfpp/exception/OperationNotImplementException.kt b/src/main/kotlin/top/mcfpp/exception/OperationNotImplementException.kt new file mode 100644 index 00000000..f9c30a88 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/exception/OperationNotImplementException.kt @@ -0,0 +1,9 @@ +package top.mcfpp.exception + +class OperationNotImplementException: RuntimeException { + + constructor() + + constructor(msg: String):super(msg) + +} diff --git a/src/main/kotlin/top/mcfpp/exception/UndefinedException.kt b/src/main/kotlin/top/mcfpp/exception/UndefinedException.kt new file mode 100644 index 00000000..54d61df1 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/exception/UndefinedException.kt @@ -0,0 +1,4 @@ +package top.mcfpp.exception + +class UndefinedException(msg: String) : RuntimeException(msg) { +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/exception/VariableConverseException.kt b/src/main/kotlin/top/mcfpp/exception/VariableConverseException.kt new file mode 100644 index 00000000..7fa3bc8d --- /dev/null +++ b/src/main/kotlin/top/mcfpp/exception/VariableConverseException.kt @@ -0,0 +1,9 @@ +package top.mcfpp.exception + +class VariableConverseException : RuntimeException { + + constructor() + + constructor(e: Exception): super(e) + +} diff --git a/src/main/kotlin/top/mcfpp/exception/VariableNotResolvedException.kt b/src/main/kotlin/top/mcfpp/exception/VariableNotResolvedException.kt new file mode 100644 index 00000000..33b7b840 --- /dev/null +++ b/src/main/kotlin/top/mcfpp/exception/VariableNotResolvedException.kt @@ -0,0 +1,5 @@ +package top.mcfpp.exception + +class VariableNotResolvedException : RuntimeException() { + +} diff --git a/src/main/kotlin/top/mcfpp/io/DatapackCreator.kt b/src/main/kotlin/top/mcfpp/io/DatapackCreator.kt new file mode 100644 index 00000000..c59d022a --- /dev/null +++ b/src/main/kotlin/top/mcfpp/io/DatapackCreator.kt @@ -0,0 +1,240 @@ +package top.mcfpp.io + +import com.alibaba.fastjson2.JSON +import com.alibaba.fastjson2.JSONObject +import top.mcfpp.Project +import top.mcfpp.model.* +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.function.ExtensionFunction +import top.mcfpp.util.LogProcessor +import top.mcfpp.util.StringHelper +import top.mcfpp.util.Utils +import java.io.* +import java.nio.file.* +import java.nio.file.attribute.BasicFileAttributes +import java.util.stream.Collectors +import kotlin.io.path.absolutePathString +import kotlin.io.path.name + + +/** + * 用于创建一个数据包的框架。 + * 一个完整的数据包包含(加粗者为重要组成部分,也是默认包含的部分): + * + * * **进度(advancement)** + * * 聊天类型(chat_type) + * * 数据包(datapacks) + * * **函数(functions)** + * * **战利品表(loot_tables)** + * * **谓词(predicates)** + * * 结构(structures) + * * 配方(recipes) + * * **物品修饰器(item_modifiers)** + * * **标签(tags)** + * * 维度(dimension) + * * 维度类型(dimension_type) + * * 世界生成(worldgen) + * + * 加粗的部分表示对一般数据包的逻辑实现几乎必不可少的部分。 + * + * + */ +object DatapackCreator { + + /** + * 在指定的路径生成一个数据包的框架 + * @param path 路径 + */ + fun createDatapack(path: String) { + LogProcessor.debug("Clearing output folder...") + //清空原输出文件夹 + delAllFile(File("$path/${Project.config.name}")) + LogProcessor.debug("Copy libs...") + //复制库 + for (lib in Project.config.includes){ + val filePath = if(!lib.endsWith("/.mclib")) { + "$lib/.mclib" + }else{ + lib + } + //逐行读取 + val fileReader = FileReader(filePath) + val jsonString = fileReader.readText() + fileReader.close() + //解析json + val json = JSONObject.parse(jsonString) as JSONObject + val scr = json.getString("src") + if(scr != null){ + val scrPath = filePath.substring(0,filePath.lastIndexOf(".")) + scr + val qwq = Paths.get(scrPath) + // 获取所有子文件夹 + val subdirectories = Files.walk(qwq, 1) + .filter(Files::isDirectory) + .skip(1) + .collect(Collectors.toList()) + for (subdirectory in subdirectories) { + //复制文件夹 + delAllFile(File(path + "\\" + subdirectory.name)) + copyAllFiles(subdirectory.absolutePathString(),path + "\\" + subdirectory.name) + } + } + } + LogProcessor.debug("Creating datapack...") + //生成 + val datapackMcMeta = DatapackMcMeta( + DatapackMcMeta.Pack( + Utils.getVersion(Project.config.version!!), + Project.config.description!! + ) + ) + val datapackMcMetaJson: String = JSON.toJSONString(datapackMcMeta) + //创建文件夹 + try { + Files.createDirectories(Paths.get("$path/${Project.config.name}/data")) + //创建pack.mcmeta + Files.write(Paths.get("$path/${Project.config.name}/pack.mcmeta"), datapackMcMetaJson.toByteArray()) + for(namespace in GlobalField.localNamespaces){ + val currPath = "$path\\${Project.config.name}\\data\\${namespace.key}" + namespace.value.field.forEachFunction {f -> + run { + if (f is Native) { + return@run + } + LogProcessor.debug("Writing File: $currPath\\functions\\${f.nameWithNamespace}.mcfunction") + Files.createDirectories(Paths.get("$currPath/functions")) + Files.write( + Paths.get("$currPath/functions/${f.nameWithNamespace}.mcfunction"), + f.cmdStr.toByteArray() + ) + } + } + namespace.value.field.forEachClass { cls -> + run { + if (cls is Native) { + return@run + } + //成员 + cls.field.forEachFunction { f-> + run { + if (f is Native) { + return@run + } + LogProcessor.debug("Writing File: $currPath\\functions\\" + f.nameWithNamespace + ".mcfunction") + //TODO 可能无法正确创建文件夹 + Files.createDirectories(Paths.get("$currPath/functions/" + StringHelper.toLowerCase(cls.identifier))) + if (f is ExtensionFunction){ + Files.createDirectories(Paths.get("$currPath/functions/" + StringHelper.toLowerCase(cls.identifier) + "/ex")) + } + Files.write( + Paths.get("$currPath/functions/" + f.nameWithNamespace + ".mcfunction"), + f.cmdStr.toByteArray() + ) + } + } + cls.staticField.forEachFunction { f -> + run { + if (f is Native) { + return@run + } + LogProcessor.debug("Writing File: $currPath\\functions\\" + f.nameWithNamespace + ".mcfunction") + //TODO 可能无法正确创建文件夹 + Files.createDirectories(Paths.get("$currPath/functions/" + StringHelper.toLowerCase(cls.identifier) + "/static")) + if (f is ExtensionFunction){ + Files.createDirectories(Paths.get("$currPath/functions/" + StringHelper.toLowerCase(cls.identifier) + "/ex_static")) + } + Files.write( + Paths.get("$currPath/functions/" + f.nameWithNamespace + ".mcfunction"), + f.cmdStr.toByteArray() + ) + } + } + //构造函数 + cls.constructors.forEach{ c -> + run { + LogProcessor.debug("Writing File: $currPath\\functions\\" + c.nameWithNamespace + ".mcfunction") + //TODO 可能无法正确创建文件夹 + Files.createDirectories(Paths.get("$currPath/functions/" + StringHelper.toLowerCase(cls.identifier))) + Files.write( + Paths.get("$currPath/functions/" + c.nameWithNamespace + ".mcfunction"), + c.cmdStr.toByteArray() + ) + } + } + } + } + } + //写入标签json文件 + for (tag in GlobalField.functionTags.values) { + LogProcessor.debug("Writing File: " + path + "\\${Project.config.name}\\data\\" + tag.namespace + "\\tags\\functions\\" + tag.tag + ".json") + Files.createDirectories(Paths.get(path + "/${Project.config.name}/data/" + tag.namespace + "/tags/functions")) + Files.write( + Paths.get(path + "/${Project.config.name}/data/" + tag.namespace + "/tags/functions/" + tag.tag + ".json"), + tag.tagJSON.toByteArray() + ) + } + } catch (e: IOException) { + throw e + } + } + + /** + * 删除原有的数据包中的全部内容。 + * @param directory 文件或文件夹 + */ + private fun delAllFile(directory: File) { + if (!directory.isDirectory) { + directory.delete() + } else { + val files: Array? = directory.listFiles() + // 空文件夹 + if (files!!.isEmpty()) { + directory.delete() + return + } + // 删除子文件夹和子文件 + for (file in files) { + if (file.isDirectory) { + delAllFile(file) + } else { + file.delete() + } + } + + // 删除文件夹本身 + directory.delete() + } + } + + @Throws(IOException::class) + fun copyAllFiles(src: String, dst: String) { + val srcFolder = Paths.get(src) + val dstFolder = Paths.get(dst) + Files.walkFileTree(srcFolder, object : SimpleFileVisitor() { + @Throws(IOException::class) + override fun preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult { + val targetPath = dstFolder.resolve(srcFolder.relativize(dir)) + try { + Files.copy(dir, targetPath, StandardCopyOption.REPLACE_EXISTING) + } catch (e: FileAlreadyExistsException) { + if (!Files.isDirectory(targetPath)) throw e + } + return FileVisitResult.CONTINUE + } + + @Throws(IOException::class) + override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult { + Files.copy(file, dstFolder.resolve(srcFolder.relativize(file)), StandardCopyOption.REPLACE_EXISTING) + return FileVisitResult.CONTINUE + } + }) + } + /** + * 数据包的元数据。用于创建pack.mcmeta文件。 + * + * @property pack + * @constructor Create empty Datapack mc meta + */ + internal class DatapackMcMeta(var pack: Pack) { + internal class Pack(var pack_format: Int, var description: String) + } +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/io/MCFPPFile.kt b/src/main/kotlin/top/mcfpp/io/MCFPPFile.kt new file mode 100644 index 00000000..59efbffa --- /dev/null +++ b/src/main/kotlin/top/mcfpp/io/MCFPPFile.kt @@ -0,0 +1,135 @@ +package top.mcfpp.io + +import org.antlr.v4.runtime.CharStream +import org.antlr.v4.runtime.CharStreams +import org.antlr.v4.runtime.CommonTokenStream +import org.antlr.v4.runtime.tree.ParseTree +import top.mcfpp.Project +import top.mcfpp.antlr.* +import top.mcfpp.lang.type.MCFPPBaseType +import top.mcfpp.model.Class +import top.mcfpp.model.function.Function +import top.mcfpp.model.field.FileField +import top.mcfpp.model.field.GlobalField +import top.mcfpp.util.LogProcessor +import top.mcfpp.util.StringHelper +import java.io.File +import java.io.FileInputStream +import java.io.IOException + +class MCFPPFile(path : String) : File(path) { + + constructor(file: File) : this(file.absolutePath) + + val field = FileField() + + val inputStream : FileInputStream by lazy { FileInputStream(this) } + + //TODO 同名文件的顶级函数之间的命名冲突 + val topFunction = Function(StringHelper.toLowerCase(this.name)) + + @Throws(IOException::class) + fun tree(): ParseTree { + if(!Project.trees.contains(this)){ + val charStream: CharStream = CharStreams.fromStream(inputStream) + val tokens = CommonTokenStream(mcfppLexer(charStream)) + val parser = mcfppParser(tokens) + Project.trees[this] = parser.compilationUnit() + } + return Project.trees[this]!! + } + + /** + * 编制类型索引 + */ + fun indexType(){ + currFile = this + McfppTypeVisitor().visit(tree()) + //类是否有空继承 + GlobalField.localNamespaces.forEach { _, u -> + u.field.forEachClass { c -> + for ((index,p) in c.parent.withIndex()){ + if(p is Class.Companion.UndefinedClassOrInterface){ + val r = p.getDefinedClassOrInterface() + if(r == null){ + LogProcessor.error("Undefined class or interface: ${p.namespaceID}") + continue + } + c.parent.remove(p) + c.parent.add(index,r) + } + } + } + } + currFile = null + } + + /** + * 编制函数索引 + */ + fun indexFunction() { + currFile = this + McfppFieldVisitor().visit(tree()) + currFile = null + } + + /** + * 编译这个文件 + */ + fun compile() { + currFile = this + Project.currNamespace = Project.config.defaultNamespace + //创建默认函数 + val func = Function( + StringHelper.toLowerCase(nameWithoutExtension + "_default"), Project.currNamespace, + MCFPPBaseType.Void + ) + Function.currFunction = func + McfppImVisitor().visit(tree()) + currFile = null + } + + companion object{ + + var currFile : MCFPPFile? = null + + /** + * 获得targetPath相对于sourcePath的相对路径 + * @param sourcePath : 原文件路径 + * @param targetPath : 目标文件路径 + * @return 返回相对路径 + */ + private fun getRelativePath(sourcePath: String, targetPath: String): String { + val pathSB: StringBuilder = StringBuilder() + if (targetPath.indexOf(sourcePath) == 0) { + pathSB.append(targetPath.replace(sourcePath, "")) + } else { + val sourcePathArray: List = sourcePath.split("/") + val targetPathArray: List = targetPath.split("/") + if (targetPathArray.size >= sourcePathArray.size) { + var i = 0 + while (i < targetPathArray.size) { + if (!(sourcePathArray.size > i && targetPathArray[i] == sourcePathArray[i])) { + pathSB.append("../".repeat(0.coerceAtLeast(sourcePathArray.size - i))) + while (i < targetPathArray.size) { + pathSB.append(targetPathArray[i]).append("/") + i++ + } + break + } + i++ + } + } else { + for (i in sourcePathArray.indices) { + if (!(targetPathArray.size > i && targetPathArray[i] == sourcePathArray[i])) { + pathSB.append("../".repeat(sourcePathArray.size - i)) + break + } + } + } + } + return pathSB.toString() + } + } + +} \ No newline at end of file diff --git a/src/main/kotlin/top/mcfpp/io/lib/LibReader.kt b/src/main/kotlin/top/mcfpp/io/lib/LibReader.kt new file mode 100644 index 00000000..529b37cd --- /dev/null +++ b/src/main/kotlin/top/mcfpp/io/lib/LibReader.kt @@ -0,0 +1,266 @@ +package top.mcfpp.io.lib + +import com.alibaba.fastjson2.JSONObject +import top.mcfpp.antlr.mcfppParser +import top.mcfpp.lang.UnresolvedVar +import top.mcfpp.lang.type.UnresolvedType +import top.mcfpp.model.Class +import top.mcfpp.model.Namespace +import top.mcfpp.model.Template +import top.mcfpp.model.UnknownClass +import top.mcfpp.model.field.CompoundDataField +import top.mcfpp.model.field.GlobalField +import top.mcfpp.model.function.* +import top.mcfpp.model.function.Function +import top.mcfpp.model.generic.ClassParam +import top.mcfpp.model.generic.GenericClass +import top.mcfpp.model.generic.GenericFunction +import top.mcfpp.util.LogProcessor +import top.mcfpp.util.StringHelper +import top.mcfpp.util.Utils +import java.io.FileReader +import java.lang.reflect.InvocationTargetException + + +object LibReader{ + fun read(path: String){ + //读取json + val fileReader = FileReader(path) + val jsonString = fileReader.readText() + fileReader.close() + //解析json + val json = JSONObject.parse(jsonString) as JSONObject + GlobalReader.fromJson(json) + } +} + +interface ILibJsonReader{ + fun fromJson(jsonObject: JSONObject): T +} + +object GlobalReader: ILibJsonReader{ + override fun fromJson(jsonObject: JSONObject): GlobalField { + val namespaces = jsonObject.getJSONArray("namespaces") + for (i in 0 until namespaces.size){ + val namespace = namespaces.getJSONObject(i) + GlobalField.libNamespaces[namespace.getString("id")] = NamespaceReader.fromJson(namespace) + } + + //解析类型 + for (n in GlobalField.libNamespaces.values){ + n.field.forEachFunction { f -> run{ + f.normalParams.forEach { p -> run{ + if(p.type is UnresolvedType){ + p.type = (p.type as UnresolvedType).resolve(f.field) + } + } } + if(f.returnType is UnresolvedType){ + f.returnType = (f.returnType as UnresolvedType).resolve(f.field) + } + } } + n.field.forEachClass { c -> run{ + c.staticField.forEachVar { v -> run{ + if(v is UnresolvedVar){ + v.replacedBy(v.resolve(c)) + } + } } + c.field.forEachVar { v -> run{ + if(v is UnresolvedVar){ + v.replacedBy(v.resolve(c)) + } + } } + c.constructors.forEach { constructor -> run{ + constructor.normalParams.forEach { p -> run{ + if(p.type is UnresolvedType){ + p.type = (p.type as UnresolvedType).resolve(constructor.field) + } + } } + } } + } } + } + + + return GlobalField + } +} + +object NamespaceReader: ILibJsonReader { + + var currNamespace : Namespace? = null + + override fun fromJson(jsonObject: JSONObject): Namespace { + val id = jsonObject.getString("id") + val namespace = Namespace(id) + currNamespace = namespace + val functions = jsonObject.getJSONArray("functions") + for (i in 0 until functions.size){ + val function = functions.getJSONObject(i) + namespace.field.addFunction(FunctionReader.fromJson(function), false) + } + val classes = jsonObject.getJSONArray("classes") + for (i in 0 until classes.size){ + val cls = ClassReader.fromJson(classes.getJSONObject(i)) + namespace.field.addClass(cls.identifier ,cls) + } + val template = jsonObject.getJSONArray("template") + for (i in 0 until template.size){ + val t = TemplateReader.fromJson(template.getJSONObject(i)) + namespace.field.addTemplate(t.identifier ,t) + } + currNamespace = null + return namespace + } +} + +object FunctionReader: ILibJsonReader { + + var currFunction : Function? = null + + override fun fromJson(jsonObject: JSONObject): Function { + val identifier = jsonObject.getString("id") + val namespace = NamespaceReader.currNamespace!!.identifier + val returnType = UnresolvedType(jsonObject.getString("returnType")) + val function = if(jsonObject.containsKey("dataClass")){ + try { + val dataClass = java.lang.Class.forName(jsonObject.getString("dataClass")).getDeclaredConstructor().newInstance() + NativeFunction(identifier, dataClass as MNIMethodContainer, returnType, namespace) + } catch (e: ClassNotFoundException) { + LogProcessor.error("Cannot find class: ${jsonObject.getString("dataClass")}", e) + UnknownFunction(identifier, namespace) + } catch (e: NoSuchMethodException) { + LogProcessor.error("Cannot find default constructor for class: ${jsonObject.getString("dataClass")}", e) + UnknownFunction(identifier, namespace) + } catch (e: InstantiationException) { + LogProcessor.error("Cannot instantiate class: ${jsonObject.getString("dataClass")}", e) + UnknownFunction(identifier, namespace) + } catch (e: IllegalAccessException) { + LogProcessor.error("Cannot access constructor for class: ${jsonObject.getString("dataClass")}", e) + UnknownFunction(identifier, namespace) + } catch (e: ClassCastException) { + LogProcessor.error("Cannot cast class: ${jsonObject.getString("dataClass")} to MNIMethodContainer", e) + UnknownFunction(identifier, namespace) + } catch (e: InvocationTargetException) { + LogProcessor.error("Cannot invoke constructor for class: ${jsonObject.getString("dataClass")}", e) + UnknownFunction(identifier, namespace) + } + } else if(jsonObject.containsKey("readonlyParam")){ + val ctx = Utils.fromByteArrayString(jsonObject["context"].toString()) + GenericFunction(identifier, namespace, returnType, ctx) + }else{ + Function(identifier, namespace, returnType) + } + currFunction = function + //参数获取 + val normalParams = jsonObject.getJSONArray("normalParams") + for (i in 0 until normalParams.size){ + val param = normalParams.getJSONObject(i) + function.normalParams.add(FunctionParamReader.fromJson(param)) + } + if(jsonObject.containsKey("readonlyParam")){ + val readonlyParams = jsonObject.getJSONArray("readonlyParam") + for (i in 0 until readonlyParams.size){ + val param = readonlyParams.getJSONObject(i) + (function as GenericFunction).readOnlyParams.add(FunctionParamReader.fromJson(param)) + } + } + currFunction = null + return function + } +} + +object ClassReader: ILibJsonReader { + + var currClass : Class? = null + + override fun fromJson(jsonObject: JSONObject): Class { + val id = jsonObject.getString("id") + val clazz = if (jsonObject.containsKey("generic")) { + val ctx = Utils.fromByteArrayString(jsonObject["context"].toString()) + GenericClass(id, NamespaceReader.currNamespace!!.identifier, ctx) + } else { + Class(id, NamespaceReader.currNamespace!!.identifier) + } + currClass = clazz + //父类 + jsonObject.getJSONArray("parents").forEach { + run { + val nspid = it.toString() + val qwq = StringHelper.splitNamespaceID(nspid) + clazz.parent.add(UnknownClass(qwq.first!!, qwq.second)) + } + } + //泛型参数 + if(jsonObject.containsKey("generic")){ + jsonObject.getJSONArray("generic").forEach { + run { + (clazz as GenericClass).readOnlyParams.add(ClassParamReader.fromJson(it as JSONObject)) + } + } + } + //域 + clazz.staticField = CompoundDataFieldReader.fromJson(jsonObject.getJSONObject("staticField")) + clazz.field = CompoundDataFieldReader.fromJson(jsonObject.getJSONObject("field")) + //构造函数 + jsonObject.getJSONArray("constructors").forEach { + run { + clazz.constructors.add(ConstructorReader.fromJson(it as JSONObject)) + } + } + currClass = null + return clazz + } +} + +object CompoundDataFieldReader: ILibJsonReader { + override fun fromJson(jsonObject: JSONObject): CompoundDataField { + val field = CompoundDataField(null, ClassReader.currClass) + jsonObject.getJSONArray("vars").forEach { + run { + val type = UnresolvedType(jsonObject.getString("type")) + val identifier = jsonObject.getString("id") + val v = UnresolvedVar(identifier, type, field) + field.putVar(v.identifier, v, false) + } + } + jsonObject.getJSONArray("functions").forEach { + run { + field.addFunction(FunctionReader.fromJson(it as JSONObject), false) + } + } + return field + } +} + +object ClassParamReader: ILibJsonReader { + override fun fromJson(jsonObject: JSONObject): ClassParam { + val identifier = jsonObject.getString("id") + return ClassParam(jsonObject.getString("type"), identifier) + } +} + +object ConstructorReader: ILibJsonReader { + override fun fromJson(jsonObject: JSONObject): Constructor { + val constructor = Constructor(ClassReader.currClass!!) + jsonObject.getJSONArray("normalParams").forEach { + run { + constructor.normalParams.add(FunctionParamReader.fromJson(it as JSONObject)) + } + } + return constructor + } +} + +object TemplateReader: ILibJsonReader