Question about input of scanners in flex

  • Thread starter Thread starter SuperSusanoo
  • Start date Start date
  • Tags Tags
    Input
Click For Summary
SUMMARY

The discussion centers on the definitions of CHARCON and BAD_CHARCON in the context of regular expressions used in programming. CHARCON is defined as a set of characters that can be included in a string, while BAD_CHARCON includes characters that are considered invalid or problematic. The use of escape sequences and special characters in these definitions is crucial for understanding how input is processed by scanners in programming languages. The conversation emphasizes the importance of context when interpreting these regular expressions.

PREREQUISITES
  • Understanding of regular expressions
  • Familiarity with programming language syntax
  • Knowledge of character encoding and escape sequences
  • Basic concepts of lexical analysis in compilers
NEXT STEPS
  • Research regular expression syntax and usage in programming languages
  • Learn about lexical analysis and its role in compiler design
  • Explore character encoding standards and their implications
  • Study the implementation of scanners in programming languages
USEFUL FOR

Programmers, computer science students, and anyone interested in understanding regular expressions and their application in input processing for programming languages.

SuperSusanoo
Messages
7
Reaction score
1

Homework Statement


I have the following set of definitions

CHARCON ('([^\\'\n]|\\[\\'"0nt])')
BAD_CHARCON ('([^\\'\n]|\\[\\'"0nt]|\\[^\\'"0nt])?[']?[\n]?)

My questions are what is a charcon?, why does it have such weird characters and why are the characters of BAD_STRINGCON bad characters?

Homework Equations

The Attempt at a Solution

 
Physics news on Phys.org
You need to consider these in the context of the program where they are found if you hope to make sense out of them. These expressions are composed of what are known as regular expressions.

In the absence of context, I can imagine that CHARCON might be those CHARACTERS which are allowed to be CONTAINED within whatever it is that the routine will process. Google might be able to help you here.

Perhaps this thread would be a better fit in our Programming & Computer Science forum?
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 23 ·
Replies
23
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
6
Views
2K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K