Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [parsing]

The tag has no usage guidance.

1
vote
1answer
37 views

What is a good strategy to locating function arguments in a buffer?

I'd like to create a few routines for manipulating function arguments in buffers, which of course requires me to first locate the arguments. Suppose that I'm operating on a buffer with a programming ...
0
votes
0answers
65 views

Getting full AST for the source code in the current buffer

How do I get the full AST for the source code in the current buffer? I've looked at a similar question and tried (semantic-fetch-tags) with the below c-mode example: #include <stdlib.h> #...
1
vote
2answers
59 views

Split command line into a list of arguments

How do I take a string giving a shell command line such as: "program arg1 arg2 \"long argument with spaces\" arg\\\"3" and turn it into a list of unquoted arguments like: ("program" "arg1" "arg2" "...
4
votes
5answers
250 views

find end of string constant

I'm using a simple (re-search-forward "\"") to find the end of string constants in my buffer. This is to copy the string in a def like (defconst name1 "some string"). The problem is that string ...
7
votes
3answers
83 views

Split a complicated string?

Q: how do I split a complicated string when whitespace delimiters aren't discriminating enough? Background I'm working with BibTeX files. I want to split an author string of the form "first-name ...
1
vote
0answers
131 views

Is CEDET/semantic obsolete? How to analyze C code for source transformation tasks?

Reading through some CEDET docs I found that the author herself recommends "to use Semantic only as source of information, and perform names completion using other packages". Does this advice also ...
4
votes
1answer
407 views

Pretty print s expressions from the command line

I've got a file containing an emacs s-expression and I want to pretty print it from the command line: Is there an easy way of doing this? Paranoia suggests I want to do as little parsing of this data ...
1
vote
0answers
47 views

How do I read and parse other Lisps in Emacs

I am playing with LFE language and I try to improve documentation lookup. Some of my efforts can be seen on my Github repo I have a function sexp-at-point which return a string enclosed by round ...
2
votes
0answers
50 views

Is it possible to detect C/C++/Java variable declarations.?

I'm writing a minor mode to handle automatic spacing of operator characters, but I'm having some trouble with C/C++. The problem is that I can't figure out how to tell in general whether a * is a ...
8
votes
0answers
624 views

How do I parse a simple grammar and obtain a syntax tree in Emacs lisp?

How can I construct a parse tree from a string and a simple grammar? Semantic seems very tricky, and SMIE does not seem to produce a parse tree. Here's an example, assuming a language that looks like ...
7
votes
3answers
418 views

How can I find surrounding parenthesis (from emacs lisp)?

Is there a way to find out the type of the surrounding parenthesis (i.e. '(', '[' or '{') around point? For example (using | to represent point) { abc, | df } should return '{', and { abc[ | ], ...
10
votes
2answers
165 views

Make forward-sexp recognize blocks defined by keywords, not just parentheses

In a language (julia) that has blocks defined by keywords such as for..end, begin..end, as well as parentheses, what is a good way to skip over such a block? Also, end is not only a block keyword, but ...
11
votes
2answers
425 views

For what languages is `syntax-ppss` appropriate?

I've been looking at a way of detecting whether point is on a comment by looking at how the current buffer is fontified. Smartparens defines sp-point-in-comment, which relies on syntax-ppss. However, ...
6
votes
2answers
599 views

Elisp function to see a date for next Wednesday

Admitting up front that I am not capable of much Lisp, I have found ways to produce the current date or a number of seconds from a date, but I am looking for a simple equivalent to shell command like ...