# Class: Parser

## ProtoBuf.DotProto. Parser

prototype parser

#### new Parser(source)

  Constructs a new Parser.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `source` | string | Source

  Source:
    - ProtoBuf.js, line 688

### Members

#### proto3 :boolean

  Whether parsing proto3 or not.

  ##### Type:

  - boolean
  Source:
    - ProtoBuf.js, line 701

#### (non-null) tn :ProtoBuf.DotProto.Tokenizer

  Tokenizer.

  ##### Type:

  - ProtoBuf.DotProto.Tokenizer
  Source:
    - ProtoBuf.js, line 695

### Methods

#### (static) parse() → (non-null) {Object}

  Parses the specified source.

  Source:
    - ProtoBuf.js, line 794

  ##### Throws:

  If the source cannot be parsed
  Type
    Error

  ##### Returns:

  Type
    Object

#### parse() → (non-null) {Object}

  Parses the source.

  Source:
    - ProtoBuf.js, line 716

  ##### Throws:

  If the source cannot be parsed
  Type
    Error

  ##### Returns:

  Type
    Object

#### toString() → {string}

  Returns a string representation of this parser.

  Source:
    - ProtoBuf.js, line 1338

  ##### Returns:

  Type
    string