Package tool.model

Examples of tool.model.ToolServiceObject



    // $ANTLR start "serviceDeclaration"
    // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:252:1: serviceDeclaration[String projectName] returns [ToolServiceObject so] : ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) ) ;
    public final ToolServiceObject serviceDeclaration(String projectName) throws RecognitionException {
        ToolServiceObject so = null;

        CommonTree IDENTIFIER15=null;
        CommonTree STRINGLITERAL17=null;
        ForteAST.qualifiedType_return qualifiedType16 = null;


        try {
            // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:258:2: ( ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) ) )
            // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:258:4: ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) )
            {
            match(input,SERVICE,FOLLOW_SERVICE_in_serviceDeclaration761); if (state.failed) return so;

            match(input, Token.DOWN, null); if (state.failed) return so;
            IDENTIFIER15=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_serviceDeclaration763); if (state.failed) return so;
            pushFollow(FOLLOW_qualifiedType_in_serviceDeclaration765);
            qualifiedType16=qualifiedType();

            state._fsp--;
            if (state.failed) return so;
            if ( state.backtracking==0 ) {

                  so = new ToolServiceObject((IDENTIFIER15!=null?IDENTIFIER15.getText():null));
                  so.setType((qualifiedType16!=null?(input.getTokenStream().toString(
                input.getTreeAdaptor().getTokenStartIndex(qualifiedType16.start),
                input.getTreeAdaptor().getTokenStopIndex(qualifiedType16.start))):null));
                  so.setPlanName(projectName);
                 
            }
            // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:264:3: ( serviceAttribute[so] )+
            int cnt19=0;
            loop19:
            do {
                int alt19=2;
                int LA19_0 = input.LA(1);

                if ( ((LA19_0>=SO_VIS && LA19_0<=SO_PASSWORD)) ) {
                    alt19=1;
                }


                switch (alt19) {
              case 1 :
                  // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:0:0: serviceAttribute[so]
                  {
                  pushFollow(FOLLOW_serviceAttribute_in_serviceDeclaration774);
                  serviceAttribute(so);

                  state._fsp--;
                  if (state.failed) return so;

                  }
                  break;

              default :
                  if ( cnt19 >= 1 ) break loop19;
                  if (state.backtracking>0) {state.failed=true; return so;}
                        EarlyExitException eee =
                            new EarlyExitException(19, input);
                        throw eee;
                }
                cnt19++;
            } while (true);

            match(input,UUID,FOLLOW_UUID_in_serviceDeclaration782); if (state.failed) return so;

            match(input, Token.DOWN, null); if (state.failed) return so;
            STRINGLITERAL17=(CommonTree)match(input,STRINGLITERAL,FOLLOW_STRINGLITERAL_in_serviceDeclaration784); if (state.failed) return so;
            if ( state.backtracking==0 ) {
              so.setUuid(so.stripQuotes((STRINGLITERAL17!=null?STRINGLITERAL17.getText():null)));
            }

            match(input, Token.UP, null); if (state.failed) return so;

            match(input, Token.UP, null); if (state.failed) return so;
View Full Code Here



    // $ANTLR start "serviceDeclaration"
    // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:231:1: serviceDeclaration[String projectName] returns [ToolServiceObject so] : ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) ) ;
    public final ToolServiceObject serviceDeclaration(String projectName) throws RecognitionException {
        ToolServiceObject so = null;


        CommonTree IDENTIFIER14=null;
        CommonTree STRINGLITERAL16=null;
        ForteAST.qualifiedType_return qualifiedType15 =null;


        try {
            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:237:2: ( ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) ) )
            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:237:4: ^( SERVICE IDENTIFIER qualifiedType ( serviceAttribute[so] )+ ^( UUID STRINGLITERAL ) )
            {
            match(input,SERVICE,FOLLOW_SERVICE_in_serviceDeclaration725); if (state.failed) return so;

            match(input, Token.DOWN, null); if (state.failed) return so;
            IDENTIFIER14=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_serviceDeclaration727); if (state.failed) return so;

            pushFollow(FOLLOW_qualifiedType_in_serviceDeclaration729);
            qualifiedType15=qualifiedType();

            state._fsp--;
            if (state.failed) return so;

            if ( state.backtracking==0 ) {
                so = new ToolServiceObject((IDENTIFIER14!=null?IDENTIFIER14.getText():null));
                so.setType((qualifiedType15!=null?(input.getTokenStream().toString(input.getTreeAdaptor().getTokenStartIndex(qualifiedType15.start),input.getTreeAdaptor().getTokenStopIndex(qualifiedType15.start))):null));
                so.setPlanName(projectName);
                }

            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:243:3: ( serviceAttribute[so] )+
            int cnt18=0;
            loop18:
            do {
                int alt18=2;
                int LA18_0 = input.LA(1);

                if ( ((LA18_0 >= SO_DIALOG && LA18_0 <= SO_VIS)) ) {
                    alt18=1;
                }


                switch (alt18) {
              case 1 :
                  // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:243:3: serviceAttribute[so]
                  {
                  pushFollow(FOLLOW_serviceAttribute_in_serviceDeclaration738);
                  serviceAttribute(so);

                  state._fsp--;
                  if (state.failed) return so;

                  }
                  break;

              default :
                  if ( cnt18 >= 1 ) break loop18;
                  if (state.backtracking>0) {state.failed=true; return so;}
                        EarlyExitException eee =
                            new EarlyExitException(18, input);
                        throw eee;
                }
                cnt18++;
            } while (true);


            match(input,UUID,FOLLOW_UUID_in_serviceDeclaration746); if (state.failed) return so;

            match(input, Token.DOWN, null); if (state.failed) return so;
            STRINGLITERAL16=(CommonTree)match(input,STRINGLITERAL,FOLLOW_STRINGLITERAL_in_serviceDeclaration748); if (state.failed) return so;

            if ( state.backtracking==0 ) {so.setUuid(so.stripQuotes((STRINGLITERAL16!=null?STRINGLITERAL16.getText():null)));}

            match(input, Token.UP, null); if (state.failed) return so;


            match(input, Token.UP, null); if (state.failed) return so;
View Full Code Here

  public String getDescription(Object anElement) {
    if (anElement instanceof ToolConstant) {
      ToolConstant data = (ToolConstant) anElement;
      return "Constant: " + data.getName();
    } else if (anElement instanceof ToolServiceObject) {
      ToolServiceObject data = (ToolServiceObject) anElement;
      return "Service Object: " + data.getToolName();
    } else if (anElement instanceof IClassComponent){
      String name = ((ToolComponent)((IClassComponent)anElement).getParent()).getToolName() + "." + ((IClassComponent)anElement).getLabelText();
      return name;
    }
    return null;
View Full Code Here

    errors+=parseUsingSOTree(tree, tokenStream, so.getName());
    if (failOnError && errors > 0Assert.fail() ;
    return errors;
  }
  private int parseUsingSOTree(CommonTree tree, TokenStream tokens, String name) throws RecognitionException{
    ToolServiceObject so = new ToolServiceObject(name);
    CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
    nodes.setTokenStream(tokens);
    ForteSOTree walker = new ForteSOTree(so, nodes);
    walker.serviceFile();
    int errors = walker.getNumberOfSyntaxErrors();
View Full Code Here

    errors+=parseUsingSOTree(tree, tokenStream, so.getName());
    if (failOnError && errors > 0Assert.fail() ;
    return errors;
  }
  private int parseUsingSOTree(CommonTree tree, TokenStream tokens, String name) throws RecognitionException{
    ToolServiceObject so = new ToolServiceObject(name);
    CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
    nodes.setTokenStream(tokens);
    ForteSOTree walker = new ForteSOTree(so, nodes);
    walker.serviceFile();
    int errors = walker.getNumberOfSyntaxErrors();
View Full Code Here

 
  public void init(IEditorSite site, IEditorInput editorInput) {
    super.init(site, editorInput);
    IFileEditorInput ifei = (IFileEditorInput)editorInput;
    IFile modelFile = ifei.getFile();
    ToolServiceObject so = ToolServiceObject.fetch(modelFile);
    setPartName(so.getToolName());
    this.setSo(so);
   
  }
View Full Code Here

        Assert.fail(e.getMessage());
      }
  }
 
  private int parseUsingSOTree(CommonTree tree, TokenStream tokens, String name) throws RecognitionException{
    ToolServiceObject so = new ToolServiceObject(name);
    CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
    nodes.setTokenStream(tokens);
    ForteSOTree walker = new ForteSOTree(so, nodes);
    walker.serviceFile();
    int errors = walker.getNumberOfSyntaxErrors();
View Full Code Here

TOP

Related Classes of tool.model.ToolServiceObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.