# Class: Parser

## ProtoBuf.DotProto. Parser

prototype parser

## Constructor

#### 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 796

##### 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 1373

##### Returns:

Type
  string