diff --git a/AlgebraicDataflowArchitectureModel/src/parser/ParserDTRAMForWebService.java b/AlgebraicDataflowArchitectureModel/src/parser/ParserDTRAMForWebService.java index fb4d05c..c90c3ea 100644 --- a/AlgebraicDataflowArchitectureModel/src/parser/ParserDTRAMForWebService.java +++ b/AlgebraicDataflowArchitectureModel/src/parser/ParserDTRAMForWebService.java @@ -46,7 +46,7 @@ throws ExpectedWebService, ExpectedBaseURL, ExpectedResources, ExpectedLeftCurlyBracket, ExpectedRightBracket, ExpectedAssignment { - doParseWebService(this.stream, editor, model); + doParseWebService(stream, editor, model); } /**-------------------------------------------------------------------------------- @@ -96,7 +96,7 @@ if(!hasSpecificToken(stream.next(), COLON)) throw new ExpectedAssignment(stream.getLine()); - // + // get service Service service = new Service(name, baseURL); String resourceName = ""; @@ -110,11 +110,25 @@ service = service.addIdentifireTemplate(identifierTemplate); } while(hasSpecificToken(stream.next(), COMMA)); + + // check the token is "}" + if(!hasSpecificToken(stream.next(), RIGHT_CURLY_BRACKET)) + throw new ExpectedRightBracket(stream.getLine()); } + // check the token is "}" + if(!hasSpecificToken(stream.next(), RIGHT_CURLY_BRACKET)) + throw new ExpectedRightBracket(stream.getLine()); + } - - private static Boolean hasSpecificToken(final String token, final String correctToken) { - return (token.equals(correctToken)); + + /**-------------------------------------------------------------------------------- + * checking the token has a token. + * + * @param token + * @param specificTokenName + */ + private static Boolean hasSpecificToken(final String token, final String specificTokenName) { + return (token.equals(specificTokenName)); } }