Examples of Syntax


Examples of org.naturalcli.Syntax

   * Test method for {@link org.naturalcli.Syntax#Syntax(java.lang.String)}.
   * @throws InvalidSyntaxException
   */
  @Test
  public final void testSyntax() throws InvalidSyntaxException {
    new Syntax("marian is the best");
    new Syntax("marian [is] [the] best");
    new Syntax("marian [<integer>] [the] best");
    new Syntax("marian is [<integer>] <identifier>");
    new Syntax("marian is <integer> ...");
    try {
      new Syntax("marian is [<integer>] ...");
      fail();
    } catch (InvalidSyntaxException e) {
    }
    try {
      new Syntax("marian is ...");
      fail();
    } catch (InvalidSyntaxException e) {
    }
    try {
      new Syntax("marian is the [<best:identifier>] <really:identifier>");
      fail();
    } catch (InvalidSyntaxException e) {
    }

    try {
      new Syntax("marian is ... [<best:identifier>] <really:identifier>");
      fail();
    } catch (InvalidSyntaxException e) {
    }
   
  }
View Full Code Here

Examples of org.netbeans.editor.Syntax

      if(null == docAssigendObjs)
    {
      // Once and again the Netbeans editor calls createSyntax() after
      // sessionEnding() was called. Then sess is null and the code below
      // would break.
      return new Syntax();
    }


    ArrayList<NetbeansSQLEditorPane> editors = _editorPanesBySessionID.get(docAssigendObjs.getSession().getIdentifier());
View Full Code Here

Examples of org.netbeans.modules.php.nette.lexer.syntax.Syntax

      return tokenCache.get(t);
    }

    InputAttributes attrs = new InputAttributes();

    Syntax syntax = (Syntax) t.getProperty("syntax");

    Language<LatteTokenId> language = LatteTokenId.language(syntax);

    TokenHierarchy<CharSequence> th2 = TokenHierarchy.create(t.text(), true, language, null, attrs);
    TokenSequence<LatteTokenId> sequence = th2.tokenSequence(language);
View Full Code Here

Examples of org.nlogo.api.Syntax

    this.command = command;
  }

  @Override
  public Syntax syntax() {
    Syntax s = command.getSyntax();
    String[] acs = command.getAgentClassString().split(":");
    if (acs[0].length() < 4) {
      acs[0] = Syntax.convertOldStyleAgentClassString(acs[0]);
    }
    if (acs.length >= 2) {
      if (acs[1].length() < 4) {
        acs[1] = Syntax.convertOldStyleAgentClassString(acs[1]);
      }
      return Syntax.commandSyntax
          (s.right(), s.dfault(), acs[0], acs[1], command.getSwitchesBoolean());
    } else {
      return Syntax.commandSyntax
          (s.right(), s.dfault(), acs[0], null, command.getSwitchesBoolean());
    }
  }
View Full Code Here

Examples of org.ontoware.rdf2go.model.Syntax

    FileInputStream fis;
    File f = new File(filename);
    try {
      fis = new FileInputStream(f);

      Syntax syntax = Syntax.forFileName(filename);
   
      try {
        m.readFrom(fis, syntax);
      } catch (ModelRuntimeException e) {
        throw new RuntimeException(e);
View Full Code Here

Examples of org.ontoware.rdf2go.model.Syntax

    writeVocab();
  }
 
  private void loadOnt() throws Exception {
    // read
    Syntax syntax = RDFTool.guessSyntax(this.inputRdfFile.toString());
    this.model = RDF2Go.getModelFactory().createModel(Reasoning.none);
    this.model.open();
    System.out.println("reading from " + this.inputRdfFile.getAbsolutePath() + " in format "
            + syntax);
    Reader reader = new BufferedReader(new FileReader(this.inputRdfFile));
View Full Code Here

Examples of xtc.lang.cpp.Syntax


    @Override
    public LexerToken getNextToken() throws IOException {
        Stream lexer = getCurrentLexer().get(0);
        Syntax s = lexer.scan();
        while (s.kind() != Syntax.Kind.EOF) {
            if (s.kind() == Syntax.Kind.CONDITIONAL) {
                Syntax.Conditional c = s.toConditional();
                if (c.tag() == Syntax.ConditionalTag.START) {
                    stack.push(stack.peek().and(translate(c.presenceCondition())));
//                    System.out.println("#if " + stack.peek());
                } else if (c.tag() == Syntax.ConditionalTag.NEXT) {
                    stack.pop();
                    stack.push(stack.peek().and(translate(c.presenceCondition())));
//                    System.out.println("#elif " + stack.peek());
                } else {
                    stack.pop();
//                    System.out.println("#endif");
                }
            }


            if (s.kind() == Syntax.Kind.CONDITIONAL)
                return new XtcToken(s, stack.peek());
            Boolean visible = stack.peek().isSatisfiable();
            if (visible) {
                if (s.kind() == Syntax.Kind.LANGUAGE)
                    return new XtcToken(s, stack.peek());
                if (s.kind() == Syntax.Kind.LAYOUT)
                    return new XtcToken(s, stack.peek());
            }

            s = lexer.scan();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.