LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

Recursive Descent, Left Assoc

Posted 08-19-2023 at 04:39 PM by astrogeek
Updated 09-05-2023 at 07:07 PM by astrogeek (Made *input const)

Discussion here and here in the Programming forum prompted me to write a few variations of an incomplete example given in the book:

Compiler Design In C by Allen I. Holub

The example suggests a simple way to obtain a left-associative parse of a list from a recursive descent parser which implements a simple right-recursive grammar.

The example is found on pages 176-177 of the book, and is incomplete, intended to illustrate the idea, not intended as working...
Moderator
Views 393 Comments 0 astrogeek is offline
Old

Flex Based Outline Generator

Posted 11-15-2021 at 02:36 AM by astrogeek
Updated 11-15-2021 at 02:43 AM by astrogeek

This little project was suggested by my participation in the thread Bison YACC compiler generator question in the Programming forum which was started by LQ member schmitta. It is a simple program which produces formatted outlines, or other indented text output, from plain text source files with a few simple markup options.

The original question in the linked thread related to a Flex/Bison generated parser, but as the thread progressed it seemed to me that some basic level of function...
Moderator
Views 1421 Comments 0 astrogeek is offline
Old

Outline Input Example

Posted 11-15-2021 at 02:32 AM by astrogeek

Following is an example input file for the post Flex Based Outline Generator.

Copy the text below into a file named example.txt in your build directory and pass it as input to the application described in the above linked post.

Code:
##########################################
# Example Outline Specification          #
# Outlines operation of outline parser   #
##########################################

.tcOutline Generator Outline
...
Moderator
Posted in Uncategorized
Views 549 Comments 0 astrogeek is offline
Old

Flex Outline Generator Spec File

Posted 11-15-2021 at 02:31 AM by astrogeek

Following is the Flex specification source for the post Flex Based Outline Generator.

Build instructions are included in the comments at top of the source below.

Copy and paste into a file named outline.l in your build directory. You may test your build using the example input file referenced in the above linked post.

Code:
%top{
/* Robert Allen Nov 14, 2021 astrogeek::linuxquestions.org
   License: Love and respect others as yourself, do unto
...
Moderator
Posted in Uncategorized
Views 521 Comments 0 astrogeek is offline
Old

Test Cases: Sign

Posted 10-10-2021 at 11:54 PM by astrogeek

This post is part of the Alphanumeric Calculator program group.

Test cases to validate handling of sign.

The test case input file:

Code:
cat tests_sign
#both
############ Numbers with signs
+0
+1
-0
-1
-1*-1
-1*+1
+1*-1
+1*+1
############ Numeric expressions with signs
positive zero
positive one
negative zero
negative one
negative one times
...
Moderator
Views 735 Comments 0 astrogeek is offline

  



All times are GMT -5. The time now is 01:34 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration