RPG Dice RollerRPG Dice Roller
Home
Guide
API
  • Contributing
  • Code of Conduct
GitHub
Home
Guide
API
  • Contributing
  • Code of Conduct
GitHub
  • API

    • Introduction
    • ComparePoint
    • Description
    • DiceRoll
    • DiceRoller
    • RollGroup
  • dice

    • FudgeDice
    • PercentileDice
    • StandardDice
  • exceptions

    • CompareOperatorError
    • DataFormatError
    • DieActionValueError
    • NotationError
    • RequiredArgumentError
  • modifiers

    • ComparisonModifier
    • CriticalFailureModifier
    • CriticalSuccessModifier
    • DropModifier
    • ExplodeModifier
    • KeepModifier
    • MaxModifier
    • MinModifier
    • Modifier
    • ReRollModifier
    • SortingModifier
    • TargetModifier
    • UniqueModifier
    • modifier-flags
  • parser

    • Parser
  • results

    • ResultGroup
    • RollResult
    • RollResults
  • traits

    • HasDescription
  • utilities

    • ExportFormats
    • NumberGenerator
    • math
    • utils

Parser

Parser

The Parser takes a notation string and parses it into objects.

It is used internally by the DiceRoll object when rolling notation, but can be used by itself if necessary.

Kind: global class
See

  • https://dice-roller.github.io/documentation/guide/notation/
  • https://en.m.wikipedia.org/wiki/Dice_notation

Parser.parse(notation) ⇒ Array

Parses the given dice notation and returns a list of dice and modifiers found

Kind: static method of Parser
Throws:

  • RequiredArgumentError Notation is required
  • SyntaxError The notation syntax is invalid
  • TypeError Notation must be a string
ParamTypeDescription
notationstringThe notation to parse
Edit this page
Last Updated: 07/02/2026, 21:45