Tabnine Logo
PerlConfiguration
Code IndexAdd Tabnine to your IDE (free)

How to use
PerlConfiguration
in
com.github.sonarperl

Best Java code snippets using com.github.sonarperl.PerlConfiguration (Showing top 7 results out of 315)

origin: sonar-perl/sonar-perl

PerlConfiguration getConfiguration() {
  return new PerlConfiguration(Charset.forName(charsetProperty.getValue()));
}
origin: sonar-perl/sonar-perl

@Test
public void getConfiguration_charset() {
  PerlConfigurationModel model = new PerlConfigurationModel();
  model.charsetProperty.setValue("UTF-8");
  assertThat(model.getCharset()).isEqualTo(Charsets.UTF_8);
  assertThat(model.getConfiguration().getCharset()).isEqualTo(Charsets.UTF_8);
  model.charsetProperty.setValue("ISO-8859-1");
  assertThat(model.getCharset()).isEqualTo(Charsets.ISO_8859_1);
  assertThat(model.getConfiguration().getCharset()).isEqualTo(Charsets.ISO_8859_1);
}
origin: sonar-perl/sonar-perl

  public static Lexer create(PerlConfiguration config) {
    return Lexer.builder()
        .withCharset(config.getCharset())
        .withFailIfNoChannelToConsumeOneCharacter(true)
        .withChannel(new NewLineChannel())
        .withChannel(new BlackHoleChannel("\\s"))
        .withChannel(commentRegexp("#[^\\n\\r]*+"))
        .withChannel(new PODChannel())
        .withChannel(commentRegexp("__END__[\\n\\r].*+"))
        .withChannel(commentRegexp("__DATA__[\\n\\r].*+"))
        .withChannel(new StringLiteralsChannel())
        .withChannel(new QuoteLikeChannel())
        .withChannel(new HeredocChannel())
        .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+[.][0-9]++" + EXP))
        .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+[.][0-9]++"))
        .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+" + EXP))
        .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+"))
        .withChannel(regexp(PerlTokenType.NUMBER, "0++"))
        .withChannel(new IdentifierAndKeywordChannel(and("[$%&@]?[a-zA-Z_]", o2n("\\w")), true, PerlKeyword.values()))
        .withChannel(new PunctuatorChannel(PerlPunctuator.values()))
        .withChannel(new UnknownCharacterChannel())
        .build();
  }
}
origin: sonar-perl/sonar-perl

public PerlScanner(SensorContext context, List<InputFile> inputFiles) {
  this.context = context;
  this.inputFiles = inputFiles;
  this.parser = PerlParser.create(new PerlConfiguration(context.fileSystem().encoding()));
}
origin: sonar-perl/sonar-perl

@BeforeClass
public static void init() {
  lexer = PerlLexer.create(new PerlConfiguration(StandardCharsets.UTF_8));
}
origin: sonar-perl/sonar-perl

public static PerlVisitorContext createContext(File file) {
  Parser<Grammar> parser = PerlParser.create(new PerlConfiguration(StandardCharsets.UTF_8));
  TestPerlFile perlFile = new TestPerlFile(file);
  AstNode rootTree = parser.parse(perlFile.content());
  return new PerlVisitorContext(rootTree, perlFile);
}
origin: sonar-perl/sonar-perl

public static PerlVisitorContext createContext(File file) {
  Parser<Grammar> parser = PerlParser.create(new PerlConfiguration(StandardCharsets.UTF_8));
  TestPerlFile pythonFile = new TestPerlFile(file);
  AstNode rootTree = parser.parse(pythonFile.content());
  return new PerlVisitorContext(rootTree, pythonFile);
}
com.github.sonarperlPerlConfiguration

Most used methods

  • <init>
  • getCharset

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JTextField (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now