Tag

BNF

1 views collected around this technical thread.

Python Programming Learning Circle
Python Programming Learning Circle
Nov 1, 2024 · Fundamentals

Understanding BNF Notation and Its Application to Python Syntax

This article explains the Backus–Naur Form (BNF) notation, its core components, and how to use it to describe Python grammar, providing concrete examples such as full‑name definitions, identifiers, and control‑flow statements, along with best‑practice tips for reading Python BNF rules.

BNFGrammarParsing
0 likes · 10 min read
Understanding BNF Notation and Its Application to Python Syntax
Python Programming Learning Circle
Python Programming Learning Circle
Nov 29, 2023 · Fundamentals

Building a Simple Python Interpreter with PLY

This article guides readers through designing and implementing a basic Python interpreter that can evaluate arithmetic expressions by defining tokens, writing a lexer and parser with PLY, specifying BNF grammar, handling precedence, and assembling a runnable program that processes user input.

BNFInterpreterLexer
0 likes · 9 min read
Building a Simple Python Interpreter with PLY
Tencent Cloud Developer
Tencent Cloud Developer
Oct 12, 2023 · Fundamentals

From 0 to 1: How to Design and Implement Your Own Scripting Language

The article walks readers through building a custom scripting language from scratch—explaining compilation basics, lexical scanning, parsing, bytecode generation, and virtual‑machine execution—using a sample language called eben to illustrate BNF syntax, variable scopes, control flow, functions, closures, object‑orientation, garbage collection, and the historical evolution of programming languages.

BNFBytecodeCompilation
0 likes · 46 min read
From 0 to 1: How to Design and Implement Your Own Scripting Language
Python Programming Learning Circle
Python Programming Learning Circle
Nov 26, 2021 · Fundamentals

Building an Arithmetic Interpreter in Python Using PLY

This article explains how to create a simple arithmetic expression interpreter in Python by leveraging the PLY (Python Lex‑Yacc) library, covering token definition, lexer implementation, BNF grammar, parser rules, operator precedence, error handling, and a complete runnable example.

BNFInterpreterLexer
0 likes · 9 min read
Building an Arithmetic Interpreter in Python Using PLY