Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

140
LINES

< > BotCompany Repo | #1012941 // parseSnippetType (TODO)

JavaX fragment (include)

1  
static S parseSnippetType_defs1 = [[
2  
define('SN_DECLS', 1);
3  
define('SN_TESTCASE', 2);
4  
define('SN_COMMENT', 3);
5  
define('SN_RUNREPORT', 4); # report after running a test case
6  
define('SN_SOURCE', 5);  # uploaded source file (Java or other)
7  
define('SN_SOLUTION', 6);  # solution tree
8  
define('SN_LUA', 7);  # Lua code (solutions have this type too)
9  
define('SN_LUA_CHATBOT', 8);  # A Lua chat-bot
10  
define('SN_LUA_TESTCASE', 9); # A test case in Lua
11  
#define('SN_LUA_SOLUTION', 10); # A text-to-text solution in Lua (now integrated as plain SN_LUA)
12  
define('SN_OBJECT', 11); # An object
13  
define('SN_LUA_IMAGE', 12);
14  
define('SN_LUA_ANIMATION', 13); # Image plus (optional) animation
15  
define('SN_LUA_GUI', 14); # Animation plus keyboard+mouse events
16  
define('SN_COMMENT', 15);  # A comment on another snippet
17  
define('SN_INOUTEXAMPLE', 16); # A conversion example with input+output
18  
define('SN_LUA_SYSTEMTEST', 17); # A free-standing test case (not requiring a solution snippet)
19  
define('SN_LUA_SERVICEBOT', 18); # A bot in the group chat
20  
define('SN_LUA_SUGGESTER', 19); # A suggester for editing snippets
21  
define('SN_RUNLOG', 20);
22  
define('SN_JAVA', 21);  # Java source code
23  
define('SN_PSEUDOCODE', 22);
24  
define('SN_IMAGE', 23); # An image stored as a blob
25  
define('SN_T2G_GUICODE', 24); # Janino code for Text2GUI
26  
define('SN_JAVA_IR', 25);  # Java image recognition script
27  
define('SN_LUA_IR', 26);  # Lua image recognition script
28  
define('SN_LUA_COMMENTER', 27);  # Lua snippet commenter script
29  
define('SN_LUA_VISUALIZER', 28);  # Lua visualizer script
30  
define('SN_LUA_PRODUCER', 29);
31  
define('SN_LUA_IMAGETRANSFORMER', 30); # Lua image transformer
32  
define('SN_LUA_ID_LEARNER', 31); # Image distinction (learner)
33  
define('SN_LUA_ID_EXECUTOR', 32); # Image distinction (executor)
34  
define('SN_LUA_LIVE', 33); # Lua Live
35  
define('SN_LUA_SNIPPET_TO_SNIPPET', 33);
36  
define('SN_JAVAX', 34);  # JavaX source code
37  
define('SN_HTML', 35);  # HTML source code
38  
#define('SN_DATA_ZIP', 36); # Data (.zip)
39  
define('SN_DATA', 37); # Data (any type)
40  
define('SN_JAVAX_TRANSLATOR', 38);  # JavaX translator
41  
define('SN_JAVAX_INPUT_TXT_OUTPUT_TXT', 39);  # Certain type of JavaX program
42  
define('SN_JAVAX_ANDROID', 40);
43  
define('SN_IOIOI', 41);
44  
define('SN_JAVAX_INC', 42);
45  
define('SN_JAVAX_INCOMPLETE', 43);
46  
define('SN_JAVAX_SNIPPETCOMMENTER', 44);
47  
define('SN_QUESTION', 45);
48  
define('SN_INFORMATION', 46);
49  
define('SN_JAVAX_TEST', 47);
50  
define('SN_NL', 48);
51  
define('SN_BLOGPOST', 49);
52  
define('SN_MICROTHEORY', 50);
53  
define('SN_SNL', 51);
54  
define('SN_USER_SUPPLIED_DIALOG', 52);
55  
define('SN_AI_CONCEPTS', 53);
56  
define('SN_JAVAX_MODULE', 54);
57  
define('SN_JAVAX_DESKTOP', 55);
58  
define('SN_AI_DRAWING', 56);
59  
# insert next here
60  
61  
define('SN_NT_SNIPPET', 80); # New Tinybrain snippet
62  
define('SN_SPACE', 81); # a space for snippets
63  
define('SN_DOCUMENT', 100);  # just a human-readable text
64  
define('SN_DOCUMENT_TASK', 101);  # human-readable text - task description
65  
define('SN_DIRECTORY', 102); # A directory of snippets
66  
define('SN_SNIPPET_TYPE', 103);
67  
define('SN_IR_TASK', 104);
68  
]];
69  
70  
static S parseSnippetType_defs2 = [[
71  
  SN_NT_SNIPPET => 'New Tinybrain snippet',
72  
  SN_MICROTHEORY => 'Microtheory',
73  
  SN_DOCUMENT => 'Document',
74  
  SN_USER_SUPPLIED_DIALOG => 'User-supplied dialog',
75  
  SN_JAVAX => 'JavaX source code',
76  
  SN_JAVAX_INC => 'JavaX fragment (include)',
77  
  SN_JAVAX_DESKTOP => 'JavaX source code (desktop)',
78  
  SN_JAVAX_INCOMPLETE => 'JavaX (incomplete)',
79  
  SN_JAVAX_TRANSLATOR => 'JavaX translator',
80  
  SN_JAVAX_ANDROID => 'JavaX source code (Android)',
81  
  SN_JAVAX_MODULE => 'JavaX module',
82  
  SN_JAVAX_TEST => 'JavaX General Test Case',
83  
  SN_JAVAX_INPUT_TXT_OUTPUT_TXT => 'JavaX (input.txt to output.txt)',
84  
  SN_JAVAX_SNIPPETCOMMENTER => 'JavaX (snippet commenter)',
85  
  SN_IOIOI => 'IOIOI',
86  
  SN_QUESTION => 'Question',
87  
  SN_NL => 'Natural language',
88  
  SN_SPACE => 'Space for snippets',
89  
  SN_DOCUMENT_TASK => 'Task description',
90  
  SN_SNL => 'Simplified Natural Language',
91  
  SN_LUA => 'Lua code',
92  
  SN_LUA_IR => 'Lua code - Image recognition',
93  
  SN_LUA_IMAGE => 'Lua code - Image',
94  
  SN_LUA_VISUALIZER => 'Lua code - Visualizer',
95  
  SN_LUA_IMAGETRANSFORMER => 'Lua code - Image transformer',
96  
  SN_LUA_CHATBOT => 'Lua code - Chat-bot',
97  
  SN_LUA_TESTCASE => 'Lua code - Test case',
98  
  SN_LUA_ANIMATION => 'Lua code - Animation',
99  
  SN_LUA_GUI => 'Lua code - GUI',
100  
  SN_LUA_SYSTEMTEST => 'Lua code - System test',
101  
  SN_LUA_SERVICEBOT => 'Lua code - Service bot',
102  
  SN_LUA_SUGGESTER => 'Lua code - Suggester',
103  
  SN_LUA_COMMENTER => 'Lua code - Snippet commenter',
104  
  SN_LUA_PRODUCER => 'Lua code - Snippet producer',
105  
  SN_LUA_ID_LEARNER => 'Lua code - Image distinction (learner)',
106  
  SN_LUA_ID_EXECUTOR => 'Lua code - Image distinction (executor)',
107  
  SN_LUA_LIVE => 'Lua Live - Lua code with side effects',
108  
  SN_LUA_SNIPPET_TO_SNIPPET => 'Lua code - Snippet-to-snippet',
109  
  SN_T2G_GUICODE => 'Java GUI source (Text2GUI/Janino)',
110  
  SN_JAVA => 'Java source code',
111  
  SN_JAVA_IR => 'Java image recognition code',
112  
  SN_PSEUDOCODE => 'Pseudo code',
113  
  SN_HTML => 'HTML',
114  
  SN_IMAGE => 'Image',
115  
  SN_RUNLOG => 'Run Log',
116  
  SN_INFORMATION => 'Information',
117  
# SN_DATA_ZIP => 'Data (.zip)',
118  
  SN_DATA => 'Data',
119  
  SN_DECLS => 'TB declarations',
120  
  SN_TESTCASE => 'TB test case',
121  
  SN_COMMENT => 'Comment',
122  
  SN_RUNREPORT => 'Run report',
123  
  SN_SOURCE => 'Source file',
124  
  SN_SOLUTION => 'TB solution tree',
125  
  SN_COMMENT => 'Comment',
126  
  SN_INOUTEXAMPLE => 'Input/output example',
127  
  SN_OBJECT => 'Object',
128  
  SN_DIRECTORY => 'Directory',
129  
  SN_SNIPPET_TYPE => 'Snippet type',
130  
  SN_IR_TASK => 'Image recognition task',
131  
  SN_BLOGPOST => 'Blog post',
132  
  SN_AI_CONCEPTS => 'AI Concepts',
133  
  SN_AI_DRAWING => 'AI Drawing'
134  
]];
135  
136  
static int parseSnippetType(S type) {
137  
  if (eqic(type, "JavaX source code (Desktop)"))
138  
    ret 55;
139  
  todo();
140  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012941
Snippet name: parseSnippetType (TODO)
Eternal ID of this version: #1012941/1
Text MD5: 3a0293475c1a3d8fb65e26b7ca81bc17
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-18 16:33:36
Source code size: 5879 bytes / 140 lines
Pitched / IR pitched: No / No
Views / Downloads: 392 / 400
Referenced in: [show references]