id
stringlengths
36
36
text
stringlengths
1
1.25M
8a205076-e777-47b6-81dc-2fc03c22b07e
public void statementList(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //statementList-> statement statementList | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("{") || token.name.equals("(") || token.name.equals("if") || token.name.eq...
85a4e5ac-45b2-4a3f-9c6e-b3074a5183dc
public void statement(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //statement-> expressionSt | compound | selectionSt | iterationSt | returns // ( || { || if || while || return if(!x.isEmpty()) { imAtoken token = x.peek(); if (token.name.eq...
2ad9c16c-0b4a-4399-93a3-dc0bd1cf65b7
public void param(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { // param-> typeSpec ID paramType typeSpec(x,y); if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.type.equals("ID")) { for(int i = decList.size() - 1; i > 0;...
e0db0e89-297a-4ef8-bd84-bbe9416fac59
public void paramType(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //paramType-> [ ] | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("[")) { x.pop(); if(!x.isEmpty()) { ...
eeac26b5-63f6-43b3-b7e7-d2d568670d76
public void parLoop(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //parLoop-> , param parLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(",")) { x.pop(); param(x,y); pa...
9737b692-24da-46bd-b668-391ffdc10d5b
public void parameter(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //parameter-> ID paramtype parLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.type.equals("ID")) { for(int i = decList.size() - 1; i > 0; i--) ...
f260856b-75f0-4956-8936-720b54583554
public void expressionSt(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //expressionSt-> expression ; | ; if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(";")) { x.pop(); } else { ...
7f641e1c-3c28-4363-bb88-35b25cf4e051
public void selectionSt(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //selectionSt-> if ( expression ) statement selectFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("if")) { //deny symbol table constructio...
42309c6c-1f1c-446f-8a71-3a32bf7adefa
public void iterationSt(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //iterationSt-> while ( expression ) statement if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("while")) { //deny symbol table construction ...
f202f5ab-5788-4490-901b-5a38351ad2b7
public void returnSt(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //returnSt-> return retFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("return")) { x.pop(); retFollow(x,y); } ...
7dcf71d3-fea1-456b-84e2-0d8db0e90875
public void expression(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //expression-> ( expression ) expFollow | NUM expFollow | ID idFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.po...
c34b2ebf-21c6-4053-9cd9-603c3f359615
public void selectFollow(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //selectFollow-> else statement | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("else")) { x.pop(); statement(x,y); ...
66966a33-3673-4a05-8b3a-3e03891bb5b4
public void retFollow(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //retFollow-> ; | expression ; if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(";")) { x.pop(); } else { ...
17aacfa1-2aea-4437-80f8-459b7d591dde
public void expFollow(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //expFollow-> termloop addExpLoop C termLoop(x,y); addExpLoop(x,y); C(x,y); }
5ac9d736-7759-4ac9-94a7-a48c45465aec
public void termLoop(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //termLoop-> mulop factor termLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("*") || token.name.equals("/")) { mulop(x,y); ...
feb2cc63-6966-4d58-a35e-f63cdc95390f
public void C(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //C-> relop addExp | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("<=") || token.name.equals("<") || token.name.equals(">") || token.name.equals(">=") || token.name.equals("==...
86cca781-ecb2-43d1-b751-213240834f7e
public void relop(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //relop-> <= | < | > | >= | == | != if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("<=") || token.name.equals("<") || token.name.equals(">") || token.name.equals(">=") || token...
635dbaee-d53d-4c6a-a8c5-09a9a392a0fc
public void addExp(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //addExp-> term addExpLoop term(x,y); addExpLoop(x,y); }
8d620a42-5dac-48a5-883e-c5017646137d
public void term(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { factor(x,y); termLoop(x,y); }
4e1fd756-f994-4705-8605-6efabf32062a
public void addExpLoop(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //addExpLoop-> addop term addExpLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("+") || token.name.equals("-")) { x.pop(); ...
cfeb00ee-b639-43ed-88de-d18ee15d95ec
public void mulop(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("*") || token.name.equals("/")) { x.pop(); } else { System.o...
cb620c77-53c1-4b8e-a5b9-8961aefffab8
public void factor(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //factor-> (expression) | NUM | ID factorFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); expression(x,y); ...
9ca68866-60d3-4e70-9513-b60c7e78c97d
public void factorFollow(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //factorFollow-> B | ( args) if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); args(x,y); if(!x...
af23bec0-ad78-4c53-ad0c-6d29da41d361
public void idFollow(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //idFollow-> BM | ( args ) expFollow Boolean corCall = true; if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); ...
e94d3f99-1806-4501-826b-563abe49dcb3
public void args(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //args-> argList | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if (token.name.equals("(") || token.type.equals("int") || token.type.equals("float") || token.type.equals("ID")) { ...
521756e4-61f9-4a69-b17d-a5dee6f43bfb
public void argList(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //argList-> expression argListLoop expression(x,y); argsListLoop(x,y); }
c2af46bb-2fcc-4b92-9dae-7caf0342c3a7
public void argsListLoop(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //argListLoop-> , expression argListLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(",")) { x.pop(); expression(x,...
8b787086-0505-46fb-8c90-a15debaa24f3
public void B(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //B-> [ expression ] | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("[")) { //flag variable as an array Array = true; ...
aa6b8ad0-0e61-48c0-af6d-3f89b4119ff0
public void M(ArrayDeque<imAtoken> x, ArrayList<Functions> y) { //M-> = expression | expFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("=")) { //need to compare each side x.pop(); ...
3add08a9-758f-491a-8714-f6839df2599a
public ArrayList<Functions> run(ArrayDeque<imAtoken> x) { while(!x.isEmpty()) { program(x); } return functionList; }
c3bcefa5-ab7c-428c-a0eb-8b47eae48b2c
public void program(ArrayDeque<imAtoken> x) { declist(x); }
0d6dda18-66d8-4792-b76f-97340cfd3a98
public void declist(ArrayDeque<imAtoken> x) { declaration(x); decloop(x); }
3293c926-926f-4a34-80af-09fb0bd7550e
public void declaration(ArrayDeque<imAtoken> x) { if(!x.isEmpty()) { typeSpec(x); imAtoken token = x.peek(); if(token.type.equals("ID")) { //Capture the declarations ID name = token.name; //Remove the ...
4c5e8e89-fd44-4740-bffc-34e20f2a9de1
public void decloop(ArrayDeque<imAtoken> x) { if(!x.isEmpty()) { imAtoken token = x.peek(); if( token.name.equals("int") || token.name.equals("void") || token.name.equals("float") ) { declaration(x); decloop(x); } ...
50162086-440b-4516-b3ba-f42ecaca7aa8
public void typeSpec(ArrayDeque<imAtoken> x) { imAtoken token = x.peek(); if( token.name.equals("int") || token.name.equals("void") || token.name.equals("float") ) { //Capture the declarations type type = token.name; //Remove the token from the stack ...
ee4cc601-8660-4ba5-8858-37674c51ae0a
public void decFollow(ArrayDeque<imAtoken> x) { //decfollow -> (params) compound | X boolean duplicate = true; if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); params(x); ...
c920cf44-33c2-4f63-973b-960f9140130b
public void params(ArrayDeque<imAtoken> x) { //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")) { //ca...
3965f426-ef8e-453f-9e9b-5b943562acd9
public void compound(ArrayDeque<imAtoken> x) { //compound-> { localDecs statementList } if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("{")) { x.pop(); localDecs(x); statementList(x); ...
1efacf64-2def-4a17-84dc-04681a9a6f98
public void X(ArrayDeque<imAtoken> x) { //X-> ; | [NUM] ; if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(";")) { x.pop(); } else { if(token.name.equals("[")) ...
17de6d6e-3d7f-43dc-810d-0b87b0e1acab
public void NUM(ArrayDeque<imAtoken> x) { if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.type.equals("Float") || token.type.equals("Int")) { x.pop(); } else { System.out.println("Error1...
0ea885cf-640e-4928-85a2-c6bf96936988
public void localDecs(ArrayDeque<imAtoken> x) { //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")) { typeSpec...
c997d541-8ffd-4199-ba52-ab0af07bef32
public void statementList(ArrayDeque<imAtoken> x) { //statementList-> statement statementList | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("{") || token.name.equals("(") || token.name.equals("if") || token.name.equals("while") || token.n...
4f21cc92-a657-4f1a-a87c-0c1bdd4ddf7b
public void statement(ArrayDeque<imAtoken> x) { //statement-> expressionSt | compound | selectionSt | iterationSt | returns // ( || { || if || while || return if(!x.isEmpty()) { imAtoken token = x.peek(); if (token.name.equals("(") || token.type.equals("Int"...
5cd83a87-aaa8-4b93-acfb-fdd26fe65178
public void param(ArrayDeque<imAtoken> x) { // param-> typeSpec ID paramType typeSpec(x); if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.type.equals("ID")) { x.pop(); paramType(x); } }...
a608acc5-f21a-409b-9ff4-7dd3497ef035
public void paramType(ArrayDeque<imAtoken> x) { //paramType-> [ ] | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("[")) { //mark as array isAr = true; //remove token ...
3bad98ca-1de9-437b-b7c7-824b2eab73c4
public void parLoop(ArrayDeque<imAtoken> x) { //parLoop-> , param parLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(",")) { x.pop(); param(x); parLoop(x); } ...
cbac18b7-10c8-4868-a2ea-ae6f7c9bf08b
public void parameter(ArrayDeque<imAtoken> x) { //parameter-> ID paramtype parLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.type.equals("ID")) { x.pop(); paramType(x); parLoop(x); ...
f5a6bce1-3919-4833-be6c-ee9c0994bac6
public void expressionSt(ArrayDeque<imAtoken> x) { //expressionSt-> expression ; | ; if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(";")) { x.pop(); } else { expressi...
951a085b-7eae-43f0-b869-5915442b812a
public void selectionSt(ArrayDeque<imAtoken> x) { //selectionSt-> if ( expression ) statement selectFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("if")) { x.pop(); if(!x.isEmpty()) ...
3a1504e9-95b5-47c6-946d-b9bff278f860
public void iterationSt(ArrayDeque<imAtoken> x) { //iterationSt-> while ( expression ) statement if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("while")) { x.pop(); if(!x.isEmpty()) { ...
677f7b3b-fa7d-4957-bda5-0c5656e42c31
public void returnSt(ArrayDeque<imAtoken> x) { //returnSt-> return retFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("return")) { x.pop(); retFollow(x); } else ...
9a949293-09ca-4f5a-af3f-3a9b8be04fd0
public void expression(ArrayDeque<imAtoken> x) { //expression-> ( expression ) expFollow | NUM expFollow | ID idFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); expression(x); ...
d7c79982-11f6-4298-a601-1549073f6434
public void selectFollow(ArrayDeque<imAtoken> x) { //selectFollow-> else statement | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("else")) { x.pop(); statement(x); } } }
88ae7442-db23-49ed-8083-4209715a6dc7
public void retFollow(ArrayDeque<imAtoken> x) { //retFollow-> ; | expression ; if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(";")) { x.pop(); } else { expression(x); ...
018bf955-dc6a-4929-9655-fab18e189579
public void expFollow(ArrayDeque<imAtoken> x) { //expFollow-> termloop addExpLoop C termLoop(x); addExpLoop(x); C(x); }
88819d08-01e4-4713-bc6c-40bdf46e65e9
public void termLoop(ArrayDeque<imAtoken> x) { //termLoop-> mulop factor termLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("*") || token.name.equals("/")) { mulop(x); factor(x); ...
905d7e37-9814-45d5-899f-e07886ea59a4
public void C(ArrayDeque<imAtoken> x) { //C-> relop addExp | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("<=") || token.name.equals("<") || token.name.equals(">") || token.name.equals(">=") || token.name.equals("==") || token.name.equals(...
f962edb6-4dab-47c6-b04a-e4f2ba29bcfb
public void relop(ArrayDeque<imAtoken> x) { //relop-> <= | < | > | >= | == | != if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("<=") || token.name.equals("<") || token.name.equals(">") || token.name.equals(">=") || token.name.equals("==") || to...
b1e2c222-6b20-4b45-abaf-a26083df6d3f
public void addExp(ArrayDeque<imAtoken> x) { //addExp-> term addExpLoop term(x); addExpLoop(x); }
9cef22d8-1610-4e82-bb5f-1762db261369
public void term(ArrayDeque<imAtoken> x) { factor(x); termLoop(x); }
57756b4d-4567-4e75-9182-6f651dca65e7
public void addExpLoop(ArrayDeque<imAtoken> x) { //addExpLoop-> addop term addExpLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("+") || token.name.equals("-")) { x.pop(); term(x); ...
e9c71627-04ee-4961-bf7b-c51a87998ddf
public void mulop(ArrayDeque<imAtoken> x) { if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("*") || token.name.equals("/")) { x.pop(); } else { System.out.println("Error: looki...
29a3e49b-70b7-4f0c-953d-a18fd2b06f86
public void factor(ArrayDeque<imAtoken> x) { //factor-> (expression) | NUM | ID factorFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); expression(x); if(!x.isEmpty...
69f55dd8-55d9-483e-9487-acdda73ec407
public void factorFollow(ArrayDeque<imAtoken> x) { //factorFollow-> B | ( args) if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); args(x); if(!x.isEmpty()) ...
cc179f83-afeb-493a-a20d-47bcb8b7a2a7
public void idFollow(ArrayDeque<imAtoken> x) { //idFollow-> BM | ( args ) expFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("(")) { x.pop(); args(x); if(!x.isEmpty()) ...
da9cd147-cc92-477f-b9c2-a5cc19672417
public void args(ArrayDeque<imAtoken> x) { //args-> argList | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if (token.name.equals("(") || token.type.equals("Int") || token.type.equals("Float") || token.type.equals("ID")) { argList(x...
539af822-7e84-4edc-bef3-de972bd7704c
public void argList(ArrayDeque<imAtoken> x) { //argList-> expression argListLoop expression(x); argsListLoop(x); }
10ce47aa-eaa0-4e3f-a157-f1804b66e9f5
public void argsListLoop(ArrayDeque<imAtoken> x) { //argListLoop-> , expression argListLoop | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals(",")) { x.pop(); expression(x); argsL...
f810d243-c595-4c7d-a1d9-48ebda64b528
public void B(ArrayDeque<imAtoken> x) { //B-> [ expression ] | empty if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("[")) { x.pop(); expression(x); if(!x.isEmpty()) {...
8b3489e3-709d-4d5f-9f45-d914f3df9997
public void M(ArrayDeque<imAtoken> x) { //M-> = expression | expFollow if(!x.isEmpty()) { imAtoken token = x.peek(); if(token.name.equals("=")) { x.pop(); expression(x); } else { ...
33c0a88c-8646-4859-b3d1-42b5e48ed950
public Functions(String x, String y, ArrayList<String> pt, ArrayList<String> pn, boolean isAr) { name = x; type = y; rType = y; if(pt.size() == 1) { pType.add(pt.get(0)); } else { for (int i = 0; i < pt.size() - 1; i++) ...
7a368f03-2e01-4c5c-b8f8-59ab4b57fb08
public Declaration(String x, String y, int a, boolean ray) { ID = x; type = y; arraySize = a; Array = ray; }
2c816fd0-c881-4efd-839f-6f1700f377c9
public SymTable () { //blank slate }
b9d55ba8-77dd-4c7f-a3db-d537ab966fd4
public Declaration lookUp(int x) { Declaration dec = stacker.get(x); return dec; }
1b6ebd67-a18c-4324-879e-1aaca9b8c353
public void insert(Declaration x) { stacker.add(x); }
65dc1228-606b-47f8-879c-1e533db336a6
public void delete() { }
733533ae-a6a7-4aaa-9402-c36b650dad61
public ArrayDeque<imAtoken> run(String[] args) { File file = new File("C:\\Users\\Drivenwanderer\\Documents\\GitHub\\LexAn\\src\\t1"); try { //File file = new File(args[0]); Scanner scanner = new Scanner(file); //File Scanner while (scanner.hasNextLin...
a6364d8f-ca8a-4dc7-b886-566527c85b65
String keyHunt(String analyzeMe, String[] sym) { boolean keyCheck = false; for (String aSym : sym) { if (analyzeMe.equals(aSym)) { imAtoken token = new imAtoken("Keyword", analyzeMe, depth,lineNum); stacker.add(token); analyzeMe = ""; ...
f5c22974-afe5-469d-b4bb-13274bb8dfe7
String idHunt(String analyzeMe) { boolean idCheck = true; for(int r = 0; r < analyzeMe.length(); r++) { if(!Character.isLetter(analyzeMe.charAt(r))) { idCheck = false; } } if(idCheck) { imAtoken token =...
f9000c36-d362-4623-85e5-a3600ad43a32
String intHunt(String analyzeMe, String[] dLim) { boolean intCheck = true; boolean errorCheck = false; for(int r = 0; r < analyzeMe.length(); r++) { for (String aDLim : dLim) { String wall = String.valueOf(analyzeMe.charAt(r)); char...
6487a41f-05f1-41e1-9b36-2aaad939f88f
String checkFloat(String analyzeMe) { int counter = 0; //Evaluate if the word is a float. String regex = "\\d*\\.?\\d+([E][+-]?\\d+)?"; Pattern floatPat = Pattern.compile(regex); //create a pattern to match Matcher match = floatPat.matcher(analyzeMe); //look for a match ...
ef1c1e2d-6374-4cff-aac3-cb74a66ff21e
public static void main(String[] args) { ArrayDeque<imAtoken> parseMe = new ArrayDeque<imAtoken>();// collection of analyzed pieces to be parsed ArrayList<Functions> functionList = new ArrayList<Functions>(); String conti = ""; //Can it be parsed? int[] x = new int[10]; Le...
51148922-5167-43b5-9176-2a56b4ef3346
public imAtoken(String t, String am, int d, int l) { type = t; name = am; depth = d; line = l; }
e7bfe583-e705-41e3-b4ce-aa579a04a502
public String toString() { return name; }
86609559-87d6-4b25-a399-daf4c3f83dab
public Item(String description, double weight, boolean canBeTaken) { this.id = "" + idSiguiente; this.idSiguiente++; this.description = description; this.weight = weight; this.canBeTaken = canBeTaken; }
cbb1114f-dfb3-47d0-a44d-7a01ad1ffc41
public String getLongDescription() { return "ID " + id + ": " + description + " (" + weight + " kg.)"; }
13a01cb6-ca91-48f2-b5fb-d1d7783eb1b0
public String getId() { return id; }
1d7d1e19-2c0e-48e7-87d5-0a1ca6d10448
public double getWeight() { return weight; }
dd16287b-bcd6-4520-b5a8-630c22e79355
public boolean canBeTaken() { return canBeTaken; }
0390a938-b54f-4d99-9761-1a31e0fc4723
public Parser() { commands = new CommandWords(); reader = new Scanner(System.in); }
4b05bf47-8a98-4833-90b1-63cbb0594d9d
public Command getCommand() { String inputLine; // will hold the full input line String word1 = null; String word2 = null; System.out.print("> "); // print prompt inputLine = reader.nextLine(); // Find up to two words on the line. Scanner tokenizer =...
8b0a1f36-c19b-49e8-b525-0ecbb81dbdef
public void showCommands(){ commands.showAll(); }
9757ac98-d44c-4d63-86e2-363473dac4a1
public Player() { currentRoom = null; visitedRooms = new Stack<>(); mochila = new ArrayList<Item>(); cargaMaxima = CARGA_MAXIMA_POR_DEFECTO; }
a25882e0-a878-402c-a686-dea0e4bf3046
public void goRoom(Command command) { if(!command.hasSecondWord()) { // if there is no second word, we don't know where to go... System.out.println("Go where?"); return; } String direction = command.getSecondWord(); // Try to leave current room...
8faaf3fe-8539-48dd-8a80-2bace036926b
public void look() { printLocationInfo(); }
5e934d14-a773-4ef9-9a50-59cd3c0a17ec
public void eat() { System.out.println("You have eaten now and you are not hungry any more"); }
c37c47a6-5622-4f12-bae4-c10e84d93e98
public void back() { if (!visitedRooms.empty()) { currentRoom = visitedRooms.pop(); printLocationInfo(); } else { System.out.println("You are at the beggining of the game"); System.out.println(); } }
cc08fc42-9446-4e5b-a385-c9c135fcc214
public void printLocationInfo() { System.out.println(currentRoom.getLongDescription()); }
371e7268-2a9f-46da-86bd-89bfb9aae60e
public void setCurrentRoom(Room nuevaRoom) { currentRoom = nuevaRoom; }
4ddc302a-cf0f-416e-9ec4-9539fbebaa64
public void items() { System.out.println("En la mochila hay " + mochila.size() + " objetos:"); for(Item item : mochila) { System.out.println(item.getLongDescription()); } }