Questions tagged [lexical]

The "Lexical" tag is used to denote a connection with words of a language, its grammar or the dictionary. Alternatively, it is also used in the context of "lexical scope," the context in which certain values are valid.

Broadly, Lexical is used to refer to words of a language. (The terms in applicable to natural (human) languages, as well as to computer programming languages. Lexical is derived from "Lexicon" and therefore the tag is also applied to questions relating to the dictionary for a language.

Finally, the tag is used in a computer programming context: Lexical Scoping. A lexical scope is the "context" within with certain rules/values apply (Example the "scope" of a local variable.)

204 questions
-1
votes
3 answers

Why is buffering used in lexical analysis?

Why is buffering used in lexical analysis?and what is best value for EOF?
-1
votes
1 answer

java lexical analyzer (for mining java code which is able to analyze it semantically)

I want a lexical analyzer for java code. Should I write my own or should i use a pre-existing tool? Is it possible to make my lexical analyzer behave the same as the Java lexical analyzer, without writing my own Regular Expressions? For example if i…
Nishat
  • 881
  • 1
  • 17
  • 30
-1
votes
3 answers

c++ converting txt file data into double variables

Hi so I started to create a program to calculate a person's GPA and save that info for future reference. My problem is that I can't figure out how to read the numbers saved in the .txt file and then store them for GPA calculating purposes. Here is…
-2
votes
1 answer

Lexical Analyzer in Java. Operators Shouldn't be Tokenized as individuals like '++' or '>=' and any unlisted tokens shouldnt print out anything

I am using a Lexical analyzer to tokenize some operators, conditions, and syntaxes. My approach is checking each and every character and when it finds a space between characters, it tokenizes the combined characters. eg. when it finds 'String' it…
hamsoace
  • 77
  • 1
  • 1
  • 8
-2
votes
1 answer

Could you fix my code to compute lexical richness?

I am trying to use LexicalRichness (https://pypi.org/project/lexicalrichness/). I copied and pasted the code: import lexicalrichness from lexicalrichness import LexicalRichness text = """Measure of textual lexical diversity, computed as the mean…
Andrea
  • 47
  • 5
-2
votes
2 answers

How to do a mathematical operation with a single string?

A single string contains two numbers and operator, the two numbers have to be detected and then do the mathematical operation. I already did the part that to detect the two numbers and the operator, but I could not make a subtring for each number…
-2
votes
2 answers

How Do You Create A Transition Diagram Based on C Code

I have to create transition diagrams for a lexical analyzer for the identifiers and numbers. The code is included below: /* recursive factorial function */ int fact (int x ) { if (x>1) return x * fact (x-1); else return 1; }…
-2
votes
1 answer

Lexical or Preprocessor issue with Xcode 4.6.1

My App could work with Xcode 4.3.3 before. But when I want to make it for adhoc test by Product -- Archive with Xcode 4.6.1, following error appears: three20UI.h, Lexical or Preprocessor issue, 'Three20UI/TTTableImageItemCell.h' file not…
user1188849
  • 107
  • 1
  • 12
-3
votes
1 answer

lexical analyzer does not detect the correct string

The lexical analyzer must accept a string with the same number of a and b. The program accepts any chain that has a and b. public static int i; /** * @param args the command line arguments */ public static void main(String[] args) { Scanner…
1 2 3
13
14