---
title: "Meaning & Key Takeaway of: which reads a little input and returns…"
description: "\"“which reads a little input and returns the token. When it needs another token, it calls yylex() again. The scanner acts as a coroutine; that is, each ..."
image: "https://sms4smile.com/quotes/i/bad/john-r-levine-66716_scanner_which-reads-a-little-input-and-returns-t_2841401.jpg"
---

#  which reads a little input and returns the token. When it…

![“which reads a little input and returns the token. When it needs another token, it calls yylex() again. The scanner acts as a coroutine; that is, each time it returns, it remembers where it was, and on the next call it picks up where it left off.” quote by John R. Levine](https://sms4smile.com/quotes/i/bad/john-r-levine-66716_scanner_which-reads-a-little-input-and-returns-t_2841401.jpg)   [Download](https://sms4smile.com/quotes/i/bad/john-r-levine-66716_scanner_which-reads-a-little-input-and-returns-t_2841401.jpg) [Open image](https://sms4smile.com/quotes/i/bad/john-r-levine-66716_scanner_which-reads-a-little-input-and-returns-t_2841401.jpg)

> ““which reads a little input and returns the token. When it needs another token, it calls yylex() again. The scanner acts as a coroutine; that is, each time it returns, it remembers where it was, and on the next call it picks up where it left off.””

John R. Levine

## About This Quote

This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.

The scanner works like a coroutine, pausing and resuming while remembering its state.

**In simple terms:** A scanner can pause and continue later.

Key Takeaway

Use coroutine patterns for efficient parsing.

Themes

programming state management coroutines

Mood

technical analytical

Type

educational practical

When to use this quote

- compiler construction
- stream processing
- event‑driven apps
- AI tokenizers

Key Concepts

lexical analysis software design

Questions to Reflect On

- When is a coroutine preferable?
- How does state retention affect performance?

A Different Perspective

Coroutines add complexity to debugging.

★ ★ ★ ★ ★   No ratings yet

## Related quotes

> [There's very little about being in a functional-M.R.I. scanner that is natural: you are flat on your back, absolutely still, with your head immobilized…](https://sms4smile.com/quotes/robin-marantz-henig/there-s-very-little-about-being-in-a-functional-m-r-i-scanner-that-is/)

[Robin Marantz Henig](https://sms4smile.com/quotes/author/robin-marantz-henig/)

> [“the first retail bar code scanner was used in 1974 to scan a pack of Wrigley’s Juicy Fruit gum in a Marsh supermarket in…](https://sms4smile.com/quotes/john-kounios/the-first-retail-bar-code-scanner-was-used-in-1974-to-scan-a-pack-of/)

John Kounios

> [“Scanners can’t choose one direction. It’s like telling a parent to choose one child to feed. It’s just not possible. A parent knows she…](https://sms4smile.com/quotes/barbara-sher/scanners-can-t-choose-one-direction-it-s-like-telling-a-parent-to/)

[Barbara Sher](https://sms4smile.com/quotes/author/barbara-sher/)

> [“I imagine there are orderly, well-organized Scanners in the world, but there can't be very many of them. It's far more common to hear…](https://sms4smile.com/quotes/barbara-sher/i-imagine-there-are-orderly-well-organized-scanners-in-the-world-but/)

[Barbara Sher](https://sms4smile.com/quotes/author/barbara-sher/)

> [I now rely on a scanner, which reproduces the passages I want to cite, and then I keep my own comments on those books…](https://sms4smile.com/quotes/doris-kearns-goodwin/i-now-rely-on-a-scanner-which-reproduces-the-passages-i-want-to-cite/)

[Doris Kearns Goodwin](https://sms4smile.com/quotes/author/doris-kearns-goodwin/)

> [“This feeling is the cause of every Scanner’s unexpected ending. The dread of being locked away from their main source of energy and joy—learning,…](https://sms4smile.com/quotes/barbara-sher/this-feeling-is-the-cause-of-every-scanner-s-unexpected-ending-the/)

[Barbara Sher](https://sms4smile.com/quotes/author/barbara-sher/)

## More by John R. Levine

> [Sound, and therefore music, can help shape or reshape our thoughts, even our cells.](https://sms4smile.com/quotes/john-r-levine/sound-and-therefore-music-can-help-shape-or-reshape-our-thoughts-even/)

John R. Levine

> [The commercial music world which I had been a part of for so many years lost its sparkle. My focus became the creation of…](https://sms4smile.com/quotes/john-r-levine/the-commercial-music-world-which-i-had-been-a-part-of-for-so-many/)

John R. Levine

> [Music can lead people to greater health and happiness.](https://sms4smile.com/quotes/john-r-levine/music-can-lead-people-to-greater-health-and-happiness/)

John R. Levine

Explore all 4 John R. Levine quotes

## More Scanner quotes

> [There's very little about being in a functional-M.R.I. scanner that is natural: you are flat on your back, absolutely still, with your head immobilized…](https://sms4smile.com/quotes/robin-marantz-henig/there-s-very-little-about-being-in-a-functional-m-r-i-scanner-that-is/)

[Robin Marantz Henig](https://sms4smile.com/quotes/author/robin-marantz-henig/)

> [“the first retail bar code scanner was used in 1974 to scan a pack of Wrigley’s Juicy Fruit gum in a Marsh supermarket in…](https://sms4smile.com/quotes/john-kounios/the-first-retail-bar-code-scanner-was-used-in-1974-to-scan-a-pack-of/)

John Kounios

> [“Scanners can’t choose one direction. It’s like telling a parent to choose one child to feed. It’s just not possible. A parent knows she…](https://sms4smile.com/quotes/barbara-sher/scanners-can-t-choose-one-direction-it-s-like-telling-a-parent-to/)

[Barbara Sher](https://sms4smile.com/quotes/author/barbara-sher/)

> [“I imagine there are orderly, well-organized Scanners in the world, but there can't be very many of them. It's far more common to hear…](https://sms4smile.com/quotes/barbara-sher/i-imagine-there-are-orderly-well-organized-scanners-in-the-world-but/)

[Barbara Sher](https://sms4smile.com/quotes/author/barbara-sher/)

> [I now rely on a scanner, which reproduces the passages I want to cite, and then I keep my own comments on those books…](https://sms4smile.com/quotes/doris-kearns-goodwin/i-now-rely-on-a-scanner-which-reproduces-the-passages-i-want-to-cite/)

[Doris Kearns Goodwin](https://sms4smile.com/quotes/author/doris-kearns-goodwin/)

> [“This feeling is the cause of every Scanner’s unexpected ending. The dread of being locked away from their main source of energy and joy—learning,…](https://sms4smile.com/quotes/barbara-sher/this-feeling-is-the-cause-of-every-scanner-s-unexpected-ending-the/)

[Barbara Sher](https://sms4smile.com/quotes/author/barbara-sher/)

Browse all 7 Scanner quotes

```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "Quotation",
            "text": "“which reads a little input and returns the token. When it needs another token, it calls yylex() again. The scanner acts as a coroutine; that is, each time it returns, it remembers where it was, and on the next call it picks up where it left off.”",
            "creator": {
                "@type": "Person",
                "name": "John R. Levine"
            },
            "isPartOf": {
                "@id": "https://sms4smile.com/quotes/#website"
            },
            "url": "https://sms4smile.com/quotes/john-r-levine/which-reads-a-little-input-and-returns-the-token-when-it-needs/",
            "about": {
                "@type": "Thing",
                "name": "Scanner"
            },
            "@id": "https://sms4smile.com/quotes/john-r-levine/which-reads-a-little-input-and-returns-the-token-when-it-needs/#quotation",
            "image": {
                "@type": "ImageObject",
                "@id": "https://sms4smile.com/quotes/i/bad/john-r-levine-66716_scanner_which-reads-a-little-input-and-returns-t_2841401.jpg",
                "contentUrl": "https://sms4smile.com/quotes/i/bad/john-r-levine-66716_scanner_which-reads-a-little-input-and-returns-t_2841401.jpg",
                "url": "https://sms4smile.com/quotes/i/bad/john-r-levine-66716_scanner_which-reads-a-little-input-and-returns-t_2841401.jpg",
                "width": 1080,
                "height": 1080,
                "caption": "“which reads a little input and returns the token. When it needs another token, it calls yylex() again. The…” — John R. Levine",
                "creditText": "SMS4Smile Quotes",
                "creator": {
                    "@id": "https://sms4smile.com/quotes/#organization"
                }
            }
        },
        {
            "@type": "BreadcrumbList",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "Home",
                    "item": "https://sms4smile.com/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "Quotes",
                    "item": "https://sms4smile.com/quotes/"
                },
                {
                    "@type": "ListItem",
                    "position": 3,
                    "name": "John R. Levine",
                    "item": "https://sms4smile.com/quotes/author/john-r-levine/"
                },
                {
                    "@type": "ListItem",
                    "position": 4,
                    "name": "“which reads a little input and...",
                    "item": "https://sms4smile.com/quotes/john-r-levine/which-reads-a-little-input-and-returns-the-token-when-it-needs/"
                }
            ],
            "@id": "https://sms4smile.com/quotes/john-r-levine/which-reads-a-little-input-and-returns-the-token-when-it-needs/#breadcrumb"
        },
        {
            "@type": "WebSite",
            "@id": "https://sms4smile.com/quotes/#website",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "publisher": {
                "@id": "https://sms4smile.com/quotes/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://sms4smile.com/quotes/#organization",
            "name": "SMS4Smile Quotes",
            "url": "https://sms4smile.com/quotes/",
            "logo": {
                "@type": "ImageObject",
                "url": "https://sms4smile.com/quotes/wp-content/themes/sq/assets/icons/icon-512.png",
                "width": 512,
                "height": 512
            }
        }
    ]
}
```
