Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def abstractmethod : Parser[List[MethodAbstractDecl]] = ("abstract" ~> typebkool) ~ identifier ~( "(" ~> opt(listofpara)<~")"~";") ^^ {
- case a~b~Some(c) =>List(MethodAbstractDecl(a,b,c))
- case a~b~ None => List(MethodAbstractDecl(a,b,List()))
- }
- def method : Parser[List[MethodImpDecl]] = methodreturn|methodnonreturn
- def methodreturn :Parser[List[MethodImpDecl]] =typebkool ~ identifier~( "(" ~> opt(listofpara)<~")") ~ blockstat ^^
- {
- case a~b~Some(c)~d => List(MethodImpDecl(a,b,c,d))
- case a~b~None~d=> List(MethodImpDecl(a,b,List(),d))
- }
- def methodnonreturn :Parser[List[MethodImpDecl]] =identifier~ ("(" ~> opt(listofpara)<~")") ~ blockstat ^^
- {
- case a~Some(b)~c => List(MethodImpDecl(null,a,b,c))
- case a~None~c => List(MethodImpDecl(null,a,List(),c))
- }
- def listofpara : Parser[List[ParamDecl]]= rep1sep(para,";") ^^
- {
- case dl => dl.foldLeft(List[ParamDecl]())((a,b) => a++b )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement