Examples of TypeParser


Examples of com.googlecode.goclipse.go.lang.parser.TypeParser

    ScopeParser   scopeParser   = new ScopeParser(tokenizer, file);

    FunctionParser functionParser = new FunctionParser(false, tokenizer, file);
    functionParser.setScopeParser(scopeParser);

    TypeParser typeParser = new TypeParser(false, tokenizer, file);
    typeParser.setScopeParser(scopeParser);

    VariableParser variableParser = new VariableParser(tokenizer, file, functionParser);
    variableParser.setScopeParser(scopeParser);

    // InterfaceParser interfaceParser = new InterfaceParser(tokenizer);

    lexer.scan(fileText);

    if (!packagePeer) {
      codeContext.page = new TokenizedPage(tokenizer.getTokenizedStream());
      codeContext.pkg = packageParser.getPckg();
      codeContext.imports.addAll(importParser.getImports());
    }

    codeContext.methods.addAll(functionParser.getMethods());
    codeContext.functions.addAll(functionParser.getFunctions());
    codeContext.types.addAll(typeParser.getTypes());
    codeContext.vars.addAll(variableParser.getVars());

    if (useExternalContext) {
     
      for (Import imp : codeContext.imports) {
View Full Code Here

Examples of com.googlecode.goclipse.go.lang.parser.TypeParser

    for (File file : files) {
      Lexer          lexer          = new Lexer();
      Tokenizer      tokenizer      = new Tokenizer(lexer);
      PackageParser  packageParser  = new PackageParser(tokenizer, file);
      FunctionParser functionParser = new FunctionParser(true, tokenizer, file);
      TypeParser     typeParser     = new TypeParser(true, tokenizer, file);

      if (file.canRead() && file.getName().endsWith(".go") && !file.getName().endsWith("_test.go")) {

        lexer.reset();
        lexer.scan(file);

        codeContext.pkg = packageParser.getPckg();
        codeContext.methods.addAll(functionParser.getMethods());
        for (Method method : functionParser.getMethods()) {
          if (method.getFile() == null) {
            method.setFile(file);
          }
        }

        codeContext.functions.addAll(functionParser.getFunctions());
        for (Function function : functionParser.getFunctions()) {
          if (function.getFile() == null) {
            function.setFile(file);
          }
        }

        codeContext.types.addAll(typeParser.getTypes());
        for (Type type : typeParser.getTypes()) {
          if (type.getFile() == null) {
            type.setFile(file);
          }
        }
View Full Code Here

Examples of com.mattinsler.guiceymongo.data.generator.parser.TypeParser

    Logger rootLogger = Logger.getRootLogger();
    if (!rootLogger.getAllAppenders().hasMoreElements())
      rootLogger.setLevel(Level.OFF);
   
    TypeRegistry registry = new TypeRegistry();
    TypeParser parser = new TypeParser(registry, _useCamelCaseKeys, _isQuiet);
    TypeGenerator generator = new TypeGenerator(registry);
   
    for (String pathName : pathNames) {
      parseFile(new File(pathName), parser);
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.loader.TypeParser

       
    };
   
    @Test
    public void testUnion(){
        ProducedType type = new TypeParser(MockLoader.instance).decodeType("a|b|c", null, mockModule, mockUnit);
        Assert.assertNotNull(type);
        TypeDeclaration declaration = type.getDeclaration();
        Assert.assertNotNull(declaration);
        Assert.assertTrue(declaration instanceof UnionType);
        UnionType union = (UnionType) declaration;
View Full Code Here

Examples of com.redhat.ceylon.compiler.loader.TypeParser

        Assert.assertTrue(types.get(2).getDeclaration() instanceof Class);
    }

    @Test
    public void testIntersection(){
        ProducedType type = new TypeParser(MockLoader.instance).decodeType("a&b&c", null, mockModule, mockUnit);
        Assert.assertNotNull(type);
        TypeDeclaration declaration = type.getDeclaration();
        Assert.assertNotNull(declaration);
        Assert.assertTrue(declaration instanceof IntersectionType);
        IntersectionType intersection = (IntersectionType) declaration;
View Full Code Here

Examples of com.redhat.ceylon.compiler.loader.TypeParser

        Assert.assertTrue(types.get(2).getDeclaration() instanceof Class);
    }

    @Test
    public void testIntersectionAndUnion(){
        ProducedType type = new TypeParser(MockLoader.instance).decodeType("a&b|c", null, mockModule, mockUnit);
        Assert.assertNotNull(type);
        TypeDeclaration declaration = type.getDeclaration();
        Assert.assertNotNull(declaration);
        Assert.assertTrue(declaration instanceof UnionType);
        UnionType union = (UnionType) declaration;
View Full Code Here

Examples of com.redhat.ceylon.compiler.loader.TypeParser

        Assert.assertTrue(unionTypes.get(1).getDeclaration() instanceof Class);
    }

    @Test
    public void testParams(){
        ProducedType type = new TypeParser(MockLoader.instance).decodeType("t2<b,c>", null, mockModule, mockUnit);
        assertTypeWithParameters(type);
       
        Assert.assertTrue(type.getVarianceOverrides().isEmpty());
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.loader.TypeParser

        Assert.assertTrue(type.getVarianceOverrides().isEmpty());
    }

    @Test
    public void testParamsVariance1(){
        ProducedType type = new TypeParser(MockLoader.instance).decodeType("t2<in b,out c>", null, mockModule, mockUnit);
        assertTypeWithParameters(type);

        Map<TypeParameter, SiteVariance> varianceOverrides = type.getVarianceOverrides();
        Assert.assertNotNull(varianceOverrides);
        Assert.assertEquals(2, varianceOverrides.size());
View Full Code Here

Examples of com.redhat.ceylon.compiler.loader.TypeParser

        Assert.assertEquals(SiteVariance.OUT, varianceOverrides.get(tps.get(1)));
    }

    @Test
    public void testParamsVariance2(){
        ProducedType type = new TypeParser(MockLoader.instance).decodeType("t2<b,out c>", null, mockModule, mockUnit);
        assertTypeWithParameters(type);

        Map<TypeParameter, SiteVariance> varianceOverrides = type.getVarianceOverrides();
        Assert.assertNotNull(varianceOverrides);
        Assert.assertEquals(1, varianceOverrides.size());
View Full Code Here

Examples of com.redhat.ceylon.compiler.loader.TypeParser

        Assert.assertEquals(SiteVariance.OUT, varianceOverrides.get(tps.get(1)));
    }

    @Test
    public void testParamsVariance3(){
        ProducedType type = new TypeParser(MockLoader.instance).decodeType("t2<in b,c>", null, mockModule, mockUnit);
        assertTypeWithParameters(type);

        Map<TypeParameter, SiteVariance> varianceOverrides = type.getVarianceOverrides();
        Assert.assertNotNull(varianceOverrides);
        Assert.assertEquals(1, varianceOverrides.size());
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.