id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
b6a93b24-28a6-4e9a-83fe-7d9dff136a1d | void appendEvent(String str) {
event.append(str);
event.setCaretPosition(event.getText().length() - 1);
} |
7cf59325-59ba-4d83-a9ac-91864b101b00 | public void actionPerformed(ActionEvent e) {
if ((e.getActionCommand().equals("stopStart"))) {
// if running we have to stop
if (server != null) {
server.stop();
server = null;
tPortNumber.setEditable(true);
stopStart.setText("Start");
return;
}
// OK start the server
int port;
... |
591db538-539d-4165-851f-e73c3aae9ec3 | public static void main(String[] arg) {
// ์๋ฒ๋ฅผ ๊ธฐ๋ณธ 1500 ํฌํธ๋ก ์์.
new ServerGUI(1500);
} |
92f463fc-c116-4ee3-b811-2c882c8eaffc | public void windowClosing(WindowEvent e) {
// ๋ง์ฝ ์๋ฒ๊ฐ ์ข
๋ฃ ๋๋ฉด ์๋ฒ๋ฅผ ๋ซ๋๋ค.
if (server != null) {
try {
server.stop(); // ์ฐ๊ฒฐ์ ์ข
๋ฃํ๋๋ก ์๋ฒ์ ํต๋ณดํ๋ค.
} catch (Exception eClose) {
}
server = null;
}
dispose();
System.exit(0);
} |
455e0184-94a9-4760-9250-641f1439b060 | public void windowClosed(WindowEvent e) {
} |
003042de-d0a5-4a80-af02-a8cf6c13c88d | public void windowOpened(WindowEvent e) {
} |
e7bda4ef-3adc-4c86-a71d-299bbc8db1bf | public void windowIconified(WindowEvent e) {
} |
0679e906-4ed2-43fe-917f-7b116217fcfb | public void windowDeiconified(WindowEvent e) {
} |
2ccb779c-b2d9-4196-bb2f-0a8d53464d09 | public void windowActivated(WindowEvent e) {
} |
5388b6d0-3185-44b5-b3e0-9bfb1e6b99e4 | public void windowDeactivated(WindowEvent e) {
} |
b5e69667-ba1f-487c-a538-004d85a3d66e | public void run() {
server.start(); // ์๋ฒ๋ฅผ ์์์ํจ๋ค.
// ์ถฉ๋์ด ์ผ์ด๋๋ ๊ฒฝ์ฐ.
stopStart.setText("Start");
tPortNumber.setEditable(true);
appendEvent("Server crashed\n");
server = null;
} |
ceb074c7-ee7b-4aa6-baa4-6751c00b7d44 | public static void main(String[] args) {
MainFrame mf = new MainFrame();
} |
f328c38d-297f-4624-b36e-9065aa956659 | public ConnectDB() {
Connection conn;
Statement stmt;
ResultSet rs;
String sql;
try {
Class.forName("com.mysql.jdbc.Driver");// ๋๋ผ์ด๋ฒ ๋ก๋ฉ: DriverManager์ ๋ฑ๋ก
} catch (ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
}
System.out.println("1. ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ฐ");
try {
String jd... |
e71069a6-e7ba-4eee-a375-7eabb474748e | public static void main (String args[]) {
int choice;
Scanner scan = new Scanner(System.in);
System.out.println("Enter the number of stacks: ");
numStack = scan.nextInt();
System.out.println("Enter the stack size: ");
stackSize = scan.nextInt();
size = numStack * stackSize;
int array[] = new in... |
828306fe-5354-43ca-b4e6-8d1c49b3553e | public static int[] push(int num, int stackNum, int array[]) {
if(stackNum < 0) {
System.out.println("Stack number cannot be negative. Aborting push()....");
return array;
}
int calc = (stackNum - 1) * stackSize;
if(calc > array.length) {
System.out.println("Incorrect stack number. Aborting push()..... |
df180b11-4388-4ad0-863e-0a98967e1096 | public static int[] pop(int stackNum, int array[]) {
if(stackNum < 0) {
System.out.println("Stack number cannot be negative. Aborting pop()....");
return array;
}
int calc = (stackNum - 1) * stackSize;
if(calc > array.length) {
System.out.println("Incorrect stack number. Aborting pop()....");
ret... |
5c38f167-cd87-4eff-bd78-2cc457afaf54 | public static void display(int array[]) {
for(int i = 0; i < size; i++) {
System.out.print(array[i]);
}
} |
121bf58b-5a2f-4207-852f-a689b6ecf70e | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter number1: ");
String num1 = scan.next();
System.out.println("Enter number2: ");
String num2 = scan.next();
boolean isInt1, isInt2;
isInt1 = isInteger(num1);
isInt2= isInteger(num2);
long n1, n2;... |
46bd51b7-e140-465b-a64e-340d4f3f1f4f | public static boolean isInteger(String num) {
try {
Integer.parseInt(num);
} catch (NumberFormatException e) {
return false;
}
return true;
} |
482d3cd9-a470-42d5-a242-3bf510d09c66 | public static void multiply(long num1, long num2) {
System.out.println(num1 + " * " + num2 + " = " + num1*num2);
} |
f2653dcb-5061-4e59-8202-b035596925aa | public static void main(String args[] ) throws Exception {
try (Scanner scanner = new Scanner(System.in)) {
int num = Integer.parseInt(scanner.nextLine());
int arr[] = new int[num];
for (int i = 0; i < num; i++) {
arr[i] = scanner.nextIn... |
2ca45727-dae3-4a33-b5e6-ce5ce6e1f01a | public static void printReverseLevel(int arr[])
{
if(arr.length == 0)
return;
Map<Integer, ArrayList<Integer>> levels = new HashMap<>();
int i = 0;
int maxLevel = 0;
int currentLevel = 1;
while(i < arr.length && arr[i] != -1)
{
... |
1aec1f00-3476-4bbc-9791-9b7713e41a33 | public static void main(String args[]) {
String word1, word2;
Scanner scan = new Scanner(System.in);
System.out.println("Enter the first word: ");
word1 = scan.next();
System.out.println("Enter the second word: ");
word2 = scan.next();
findNoncommon(word1, word2);
} |
0724cc0e-b18c-4ab3-9177-06432229ab80 | public static void findNoncommon(String word1, String word2) {
HashSet<Character> h1 = new HashSet<Character>();
HashSet<Character> h2 = new HashSet<Character>();
for(int i = 0; i < word1.length(); i++) {
h1.add(word1.charAt(i));
}
for(int i = 0; i < word2.length(); i++) {
h2.add(word2.charAt(i));... |
31ceabfd-f98d-4534-b74c-509ed7ba2f26 | public static void main(String[] args) {
test();
} |
42af3fba-6759-41fd-b989-dc60f4438df7 | public static long stringToLong(String num) {
if (null == num || num.length() == 0) {
System.out.println("Empty entry.");
return -1;
}
Boolean res = checkIfNum(num);
if (!res) {
return -1;
}
int len = num.length();
int i = 0;
Boolean neg = false;
long result = 0;
while (i < len) {
... |
fb12bbf0-7cec-4c9c-aeea-edcf1d5f991d | public static Boolean checkIfNum(String num) {
return num.matches("[-+]?\\d*\\d+");
} |
486fab32-4997-4a41-886c-c11ccfe1139d | public static void test() {
String num;
Scanner scan = new Scanner(System.in);
System.out.println("Enter the number: ");
num = scan.next();
System.out.println("NUMBER IS: " + stringToLong(num));
} |
a22598d2-07d6-412a-91a8-90647c03ed51 | public static void main(String[] args) throws Exception {
Scanner scan = new Scanner(System.in);
List<Integer> list = new ArrayList<Integer>();
String input;
try {
while (!(input = scan.nextLine()).equals("")) {
int num = Integer.parseInt(input);
if (num < 0) {
System.out.println(FAIL);
re... |
3f325978-6a52-478c-8299-f2747d4982f2 | public static void arrayHopper(Integer arr[]) {
if (null == arr || arr.length == 0)
return;
int dp[] = new int[arr.length];
for (int i = 0; i < arr.length; i++) {
if (i == 0) {
dp[0] = 0;
} else {
dp[i] = Integer.MAX_VALUE;
}
}
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j... |
8c52597b-8547-4916-bf24-5783d074ab49 | public static void printHops(List<Integer> hops) {
for (int i = hops.size() - 1; i >= 0; i--) {
System.out.print(hops.get(i) + ", ");
}
System.out.print("out");
} |
87251c07-9067-4759-b595-7c0afee2d7bc | public Node(int num) {
this.item = num;
} |
0bd5f7ad-8b4a-4363-b552-482f753f3926 | public TrinaryTree(Node node) {
this.node = node;
} |
e1d32d30-7acf-43a8-bffd-b5fcd05e958c | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter number of nodes in the tree: ");
int num = scan.nextInt();
TrinaryTree root = new TrinaryTree(null);
if (num <= 0) {
System.out.println("No elements to enter in the tree");
return;
}
for (int ... |
d1663f4f-657b-4d1f-a0ea-d8f5409f15bb | public static Node insertTree(int num, Node root) {
if (root == null) {
Node node = new Node(num);
root = node;
return root;
}
if (root.item == num) {
Node node = new Node(num);
root.center = node;
return root;
}
if (num < root.item) {
root.left = insertTree(num, root.left);
} else {
... |
d65dcb6d-2e0d-4c6a-b55c-f3b8d8049656 | public static Node deleteNode(int value, Node root) {
if (null == root) {
System.out.println(value + " does not exist in the tree");
return null;
}
if (value < root.item) {
root.left = deleteNode(value, root.left);
} else if (value > root.item) {
root.right = deleteNode(value, root.right);
} els... |
340245d6-b396-4ce3-bea8-d531f083ea37 | public static Node getMin(Node root) {
if (null == root) {
return null;
}
if (root.left == null) {
return root;
}
return getMin(root.left);
} |
2169c4fb-8267-477b-bb30-5332d4dcbc48 | public static void printTree(Node root) {
if (root == null) {
return;
}
printTree(root.left);
System.out.print(root.item + " ");
if (root.center != null)
System.out.print(root.center.item + " ");
printTree(root.right);
} |
40dbee10-2939-45d6-b9ea-accaa0022d28 | public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the number: ");
int num = scan.nextInt();
if(num < 0) {
System.out.println("Number is negative. Cannot decode....");
return;
}
int len = (int) Math.log10(num) + 1;
int res = 0;
res +=... |
664d0d08-8298-43c5-bb25-98837c908b81 | public static int decodeEachAlpha(int num, int len) {
StringBuilder sb = new StringBuilder();
int res;
for(int i = 0; i < len; i++) {
res = num % 10;
res -= 1;
res += 97;
sb.append((char) res);
num = num / 10;
}
sb.reverse();
System.out.println(sb.toString());
if(sb.length() > 0)
... |
323e99aa-87eb-4bd3-b0cd-7fbcaf0368b3 | public static int decodeFromBeginning(int num, int len) {
StringBuilder sb = new StringBuilder();
int res, pow, toPow;
while (num != 0) {
if(len - 2 > 0)
toPow = len - 2;
else if(len - 1 > 0)
toPow = len - 1;
else
toPow = 0;
pow = (int) Math.pow(10, toPow);
res = (int) num / pow;
... |
8783b920-f494-4957-bc7c-c9dae7da93ec | public static int decodeFromEnd(int num, int len) {
StringBuilder sb = new StringBuilder();
int res;
for(int i = 0; i < len; i++) {
if(num % 100 < 26) {
res = num % 100;
res -= 1;
res += 97;
sb.append((char) res);
num = num / 100;
i++;
} else {
res = num % 10;
res -= 1;
... |
6210696d-4c78-4cd8-b7bb-b41bf02e7532 | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter number of elements in the list: ");
int num = scan.nextInt();
System.out
.println("-----------Enter the price of an ounce of gold on each of the "
+ num + " days-----------");
int[] arr = new i... |
cb50463f-5222-4894-8c01-56d2863451b2 | public static void findBestProfit(int[] arr) {
if (null == arr || arr.length <= 0) {
System.out.println("Empty cost record.");
return;
}
if (arr.length == 1) {
System.out.println("Best Profit is: " + 0);
return;
}
int min = 0;
int[] best = new int[2];
min = arr[0];
best[0] = arr[0];
best... |
750e34d9-ec42-457d-bc5f-5cae40c33ed1 | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string: ");
String str = scan.next();
Boolean res = checkIfUnique(str);
if (res) {
System.out.println(str + " has unique characters!");
} else {
System.out.println(str + " does not have uniqu... |
cf775845-34b8-4e5c-bf74-684a9eff9c95 | public static Boolean checkIfUnique(String str) {
int len = str.length();
if (len == 0 || null == str) {
System.out.println("Empty string!");
System.exit(0);
}
if (len > 256) {
return false;
}
boolean[] charfound = new boolean[256];
for (int i = 0; i < len; i++) {
int num = str.charAt(i);
... |
771cb340-994a-4e9d-a361-8242298966de | public static void main(String[] args) {
LinkedList<Integer> list = new LinkedList<Integer>();
createList(list);
System.out.println(list);
findKthElement(list);
} |
049dca35-0c26-4073-8e70-8429c4ce8646 | public static void createList(LinkedList<Integer> list) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter number of elements in the list: ");
int num = scan.nextInt();
for (int i = 0; i < num; i++) {
System.out.println("Enter the number: ");
list.add(scan.nextInt());
}
} |
813e2ffe-dd0a-491a-814a-4e6ce27ea845 | public static void findKthElement(LinkedList<Integer> list) {
if(list.isEmpty() || null == list) {
System.out.println("Empty list");
return;
}
Scanner scan = new Scanner(System.in);
System.out.println("Enter the position of the element: ");
int pos = scan.nextInt();
if(pos > list.size()) {
Sy... |
9198f8f5-3333-4ea3-b61b-a3e0e9bcfefb | public static void main(String[] args) {
// TODO Auto-generated method stub
} |
57a502b8-6eab-4b13-aa90-2e12d592ea34 | public static void main(String[] args) {
LinkedList<Integer> list = new LinkedList<Integer>();
createList(list);
System.out.println(list);
removeDuplicates(list);
System.out.println("After removal of duplicates: " + list);
} |
8e60a969-b619-4ab3-8fcf-169a0b41fec9 | public static void createList(LinkedList<Integer> list) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter number of elements in the list: ");
int num = scan.nextInt();
for (int i = 0; i < num; i++) {
System.out.println("Enter the number: ");
list.add(scan.nextInt());
}
} |
ef986d9f-f82e-4325-b1b8-93eae922bbaf | public static void removeDuplicates(LinkedList<Integer> list)
{
int size = list.size();
int i = 0;
while(i < size)
{
int j = i + 1;
while(j < size)
{
if(list.get(i) == list.get(j))
{
list... |
2b5f58f6-a6ba-400c-926a-8373bd82ed50 | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string1: ");
String str1 = scan.next();
System.out.println("Enter the string2: ");
String str2 = scan.next();
boolean res = checkPermutation(str1, str2);
if (res) {
System.out.println(str2 + "... |
8858bb82-4554-458e-9533-95d099071458 | public static boolean checkPermutation(String str1, String str2) {
if (null == str1 || null == str2 || str1.isEmpty() || str2.isEmpty()) {
return false;
}
if (str1.length() != str2.length()) {
return false;
}
Map<Character, Integer> map = new HashMap<Character, Integer>();
int len = str1.length() - ... |
d84de9d7-21ce-4ca9-9edb-5489e2463bae | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string: ");
String str = scan.nextLine();
replaceSpace(str);
} |
d293ce67-dd79-463b-b192-5c4e8dbb106e | public static void replaceSpace(String str) {
if (null == str) {
System.out.println("Empty String!");
System.exit(0);
}
String result = new String();
for (int i = 0; i < str.length(); i++) {
result += ((str.charAt(i) == ' ') ? "%20" : str.charAt(i));
}
System.out.println(result);
} |
d5ccbe13-b776-47ef-a4bd-b5f846f5f730 | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string: ");
String str = scan.next();
str = compressedString(str);
System.out.println("Compressed string: " + str);
} |
87c4bcd2-f543-4089-98aa-a04d99704787 | public static String compressedString(String str) {
if (null == str) {
System.out.println("Empty String!");
System.exit(0);
}
if (str.length() == 1) {
return str;
}
int len = str.length();
int count = 0;
String res = new String();
res += str.charAt(0);
count++;
for (int i = 1; i < len; i+... |
43496768-fff7-4d57-be62-89c265e15ceb | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string: ");
String str = scan.next();
Boolean res = checkIfUnique(str);
if (res) {
System.out.println(str + " has unique characters!");
} else {
System.out.println(str + " does not have uniqu... |
3234df04-c96f-485b-8d0f-ad8235daa759 | public static Boolean checkIfUnique(String str) {
int len = str.length();
if (len == 0 || null == str) {
System.out.println("Empty string!");
System.exit(0);
}
if (len > 256) {
return false;
}
boolean[] charfound = new boolean[256];
for (int i = 0; i < len; i++) {
int num = str.charAt(i);
... |
84e9cff5-d5c9-4606-9031-e285bc5c3df1 | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string: ");
String str = scan.next();
reverse(str);
} |
77515a47-d111-40f9-889a-5fc3bcd31afd | public static void reverse(String str) {
if (str.length() == 0 || null == str) {
System.out.println("Empty string!");
System.exit(0);
}
StringBuilder sb = new StringBuilder(str);
int end = str.length() - 1;
int start = 0;
while (start <= end) {
char temp = str.charAt(start);
sb.setCharAt(start,... |
b714d582-adcf-4239-82e4-bd27f1d75809 | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the string1: ");
String str1 = scan.nextLine();
System.out.println("Enter the string2: ");
String str2 = scan.nextLine();
isSubstring(str1, str2);
} |
03e1f8d0-6770-4468-8c95-9ba5802f89ec | public static void isSubstring(String str1, String str2) {
if (str1.isEmpty() || str2.isEmpty() || null == str1 || null == str2) {
System.out
.println("Cannot perform check, the string(s) entered might be empty");
System.exit(0);
}
if (str1.length() != str2.length()) {
System.out.println(str2 + "... |
dbac1b5e-9647-459e-8dd6-155887bf405a | public MapList(){
maplist = new ArrayList<Map>();
} |
9786138e-d0a0-425a-9e53-cfc3f951727f | public void addMap(String mapName, String fileName){
Map map = new Map(mapName);
map.readMap(fileName);
maplist.add(map);
} |
34fc00c9-097e-461e-bda6-57461037938a | public static void leftClick(){
try{
Robot robot = new Robot();
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.delay(clickDelay);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
} catch (AWTException e) {
e.printStackTrace();
}
} |
9f4b1f84-2a5d-49a0-94d8-ee9be2c3b59a | public static void press(int key){
try{
Robot robot = new Robot();
robot.keyPress(key);
robot.delay(pressDelay);
robot.keyRelease(key);
} catch (AWTException e) {
e.printStackTrace();
}
} |
a48b9dae-1918-4001-8a5a-5a980821624d | Pokedex() {
pokemonList = new ArrayList();
} |
63d1ddfb-874e-41b6-8107-0977423c6722 | public void addPokemon() {
Scanner in = new Scanner(System.in);
String pokemonName = null;
try {
pokemonName = in.nextLine();
System.out.println(pokemonName);
Thread.sleep(4000);
pokemonList.add(PokemonIdentify.newPokemon(pokemonName));
}... |
e3ac57c0-82f0-4bb5-8b2f-c4e44a6814ad | public void move(ArrayList<String> moveList){
for(String move : moveList){
switch (move) {
case "u": Controls.up(); break;
case "d": Controls.down(); break;
case "l": Controls.left(); break;
case "r": Controls.right(); break;
case "a": Cont... |
d723678c-bfff-4d82-a573-ed97ec24cddf | public static void main(String[] args) {
Pokedex pokedex;
MapList mapList;
ObjectInputStream objIn;
//Loading poke.dex file
try{
objIn = new ObjectInputStream(new FileInputStream("Poke.dex"));
pokedex = (Pokedex) objIn.readObject();
objIn.clo... |
33e44370-1cf6-47dd-999b-02df8140b89c | public static void a(){
ClickAndKeyPress.press(KeyEvent.VK_Z);
} |
0c99a4bf-5356-4209-9c93-9b6fbe0e3235 | public static void b(){
ClickAndKeyPress.press(KeyEvent.VK_X);
} |
49e836cb-361d-49fa-aa68-34396e26b5aa | public static void up(){
ClickAndKeyPress.press(KeyEvent.VK_UP);
} |
abdf0994-7e41-4abb-8887-15665ba56fbb | public static void down(){
ClickAndKeyPress.press(KeyEvent.VK_DOWN);
} |
cb862de8-1c6e-45ad-a651-c7a0ea2cbe73 | public static void left(){
ClickAndKeyPress.press(KeyEvent.VK_LEFT);
} |
44cebfdc-0bb3-43ec-aa53-4ae935e798f3 | public static void right(){
ClickAndKeyPress.press(KeyEvent.VK_RIGHT);
} |
99b0e5c2-4948-496e-9b1b-9d0bcb034681 | public static Color[] getColors(){
try {
Color[] colors = new Color[5];
Robot robot = new Robot();
colors[0] = robot.getPixelColor(firstPixel[0],firstPixel[1]);
colors[1] = robot.getPixelColor(secondPixel[0],secondPixel[1]);
colors[2] = robot.getPixelC... |
32d7dbc9-fa99-4bf7-bcde-2694197cb9af | public static Pokemon newPokemon(String name){
return (new Pokemon(name, getColors()));
} |
60c8eed4-90fa-4e49-8874-8258602176d0 | public Map(String mapName){
this.name = mapName;
this.map = null;
} |
845e1bbd-42f7-4982-a7d9-967f6937081a | public void readMap(String fileName){
try{
File file = new File(fileName);
in = new Scanner(file);
width = in.nextInt();
height = in.nextInt();
for (int i = 0; height > i; i++){
char[] line = in.nextLine().toCharArray();
... |
4e1ca259-6f7e-4d75-8740-8437da9af863 | public boolean isRock(int x, int y){
return (map[x][y] == rock);
} |
c158c89c-3887-445e-8c1d-e2bf6a17f92a | public boolean isWater(int x, int y){
return (map[x][y] == water);
} |
ad0b747e-6c26-4bc9-993f-44a1c6ab8b02 | public boolean isGrass(int x, int y){
return (map[x][y] == grass);
} |
562674d6-5dc0-4b49-a795-321861945fe7 | public boolean isRoad(int x, int y){
return (map[x][y] == road);
} |
35d1f400-95d0-4b34-856a-445fee859946 | Pokemon(String name, Color[] colorList){
this.name = name;
first = colorList[0];
second = colorList[1];
third = colorList[2];
fourth = colorList[3];
} |
1d5f289e-af0c-4c06-99a7-c82a308a98d8 | public String run(ArrayDeque<imAtoken> x, ArrayList<Functions> y, String conti)
{
while(!x.isEmpty())
{
//create global variable list
SymTable symtab = new SymTable();
decList.add(symtab);
program(x,y);
}
conti = "The code can be pars... |
815e7672-a1f0-4968-8867-376d944e2e1c | public void program(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
declist(x,y);
} |
c218f834-5901-42c6-a908-d32f51673460 | public void declist(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
declaration(x,y);
decloop(x,y);
} |
68d53529-5465-499b-b417-b407deb16f89 | public void declaration(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
if(!x.isEmpty())
{
typeSpec(x,y);
imAtoken token = x.peek();
if(token.type.equals("ID"))
{
for(int i = decList.size() - 1; i > 0; i--)
{
... |
a101bacd-0327-4d18-9eb3-2dee46abcbd1 | public void decloop(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
if(!x.isEmpty())
{
imAtoken token = x.peek();
if( token.name.equals("int") || token.name.equals("void") || token.name.equals("float") )
{
declaration(x,y);
declo... |
b9b241c5-7ab2-4515-b829-b9ba53854ad7 | public void typeSpec(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
imAtoken token = x.peek();
if( token.name.equals("int") || token.name.equals("void") || token.name.equals("float") )
{
//capture declaration type
type = token.name;
//remove token
x.p... |
caa6185c-b320-48cc-aa79-cfdf17365c78 | public void decFollow(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
//decfollow -> (params) compound | X
boolean duplicate = true;
if(!x.isEmpty())
{
imAtoken token = x.peek();
if(token.name.equals("("))
{
x.pop();
... |
2936ed3e-7df5-4de0-815e-2b08d0599806 | public void params(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
//params-> int ID paramtype parLoop | float ID paramtype parLoop | void parameter
if(!x.isEmpty())
{
imAtoken token = x.peek();
if(token.name.equals("int") || token.name.equals("float"))
... |
49852efe-69aa-4a0e-9bc0-6fdedc3b94fe | public void compound(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
//compound-> { localDecs statementList }
if(!x.isEmpty())
{
imAtoken token = x.peek();
if(token.name.equals("{"))
{
if(ifWhile == 0)
{
... |
52d6b7ba-502a-49b2-88ef-340cc88b3246 | public void X(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
//X-> ; | [NUM] ;
Array = false;
boolean duplicate = true;
if(!x.isEmpty())
{
imAtoken token = x.peek();
if(token.name.equals(";"))
{
if(decList.get(decList.... |
21cb775f-b697-4eea-898d-764547633741 | public void NUM(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
if(!x.isEmpty())
{
imAtoken token = x.peek();
if(token.type.equals("float") || token.type.equals("int"))
{
if(Array && token.type.equals("int"))
{
... |
fc43fc3b-7954-4c72-919d-1ca5b7230f53 | public void localDecs(ArrayDeque<imAtoken> x, ArrayList<Functions> y)
{
//localDecs-> typeSpec ID X localDecs | empty
if(!x.isEmpty())
{
imAtoken token = x.peek();
if(token.name.equals("int") || token.name.equals("void") || token.name.equals("float"))
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.