search for: num_const

Displaying 17 results from an estimated 17 matches for "num_const".

Did you mean: mul_const
2018 Jul 30
2
Problem with parseData
...ta = c(6, 1, 1, 4, 6, 6, 3, 3, 5, 7, 7)" [5] "parseData = c(7, 1, 3, 2, 4, 5, 10, 12, 11, 13, 14)" [6] "parseData = c(0, 3, 7, 7, 5, 7, 12, 0, 0, 14, 0)" [7] "parseData = c(\"expr\", \"SYMBOL\", \"expr\", \"LEFT_ASSIGN\", \"NUM_CONST\", \"expr\", \"SYMBOL\", \"expr\", \"EQ_ASSIGN\", \"NUM_CONST\", \"expr\")" [8] "parseData = c(FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE)" [9] "parseData = c(\"y <- 5\", \...
2014 Jun 12
1
regression bug with getParseData and/or parse in R-3.1.0
...With R-3.1.0 I get: > getParseData(parse(text = "{1}", keep.source = TRUE)) line1 col1 line2 col2 id parent token terminal text 7 1 1 1 3 7 9 expr FALSE 1 1 1 1 1 1 7 '{' TRUE { 2 1 2 1 2 2 3 NUM_CONST TRUE 1 3 1 2 1 2 3 5 expr FALSE 4 1 3 1 3 4 7 '}' TRUE } Which has two problems: 1) the parent of the first expression (id=7) should be 0 2) the parent of the expression with id=3 should be 7 For reference, with R-3.0.2:...
2018 Oct 02
1
Problem with parseData
..., 7)" >> [5] "parseData = c(7, 1, 3, 2, 4, 5, 10, 12, 11, 13, 14)" >> [6] "parseData = c(0, 3, 7, 7, 5, 7, 12, 0, 0, 14, 0)" >> [7] "parseData = c(\"expr\", \"SYMBOL\", \"expr\", \"LEFT_ASSIGN\", >> \"NUM_CONST\", \"expr\", \"SYMBOL\", \"expr\", \"EQ_ASSIGN\", >> \"NUM_CONST\", \"expr\")" >> [8] "parseData = c(FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, >> TRUE, TRUE, FALSE)" >> [9] "parseD...
2020 Jan 15
4
A bug understanding F relative to FALSE?
...'(' TRUE ( ## 4 1 3 1 3 4 6 SYMBOL TRUE F ## 6 1 3 1 3 6 14 expr FALSE ## 5 1 4 1 4 5 14 ',' TRUE , ## 9 1 5 1 9 9 10 NUM_CONST TRUE FALSE ## 10 1 5 1 9 10 14 expr FALSE ## 11 1 10 1 10 11 14 ')' TRUE ) I would expect that token for F is the same as token for FALSE. Thank you! Iago [[alternative HTML version deleted]]
2014 Jan 25
0
interpreting the output of getParseData()
...1 14 7 25 '{' TRUE { 22 1 15 1 30 22 23 expr FALSE 8 1 15 1 16 8 22 IF TRUE if 9 1 17 1 17 9 13 '(' TRUE ( 10 1 18 1 21 10 11 NUM_CONST TRUE TRUE 11 1 18 1 21 11 13 expr FALSE 12 1 22 1 22 12 13 ')' TRUE ) 14 1 23 1 23 14 15 NUM_CONST TRUE 1 15 1 23 1 23 15 17 expr FALSE 16 1 25...
2018 Aug 16
0
Problem with parseData
...6, 6, 3, 3, 5, 7, 7)" > [5] "parseData = c(7, 1, 3, 2, 4, 5, 10, 12, 11, 13, 14)" > [6] "parseData = c(0, 3, 7, 7, 5, 7, 12, 0, 0, 14, 0)" > [7] "parseData = c(\"expr\", \"SYMBOL\", \"expr\", \"LEFT_ASSIGN\", > \"NUM_CONST\", \"expr\", \"SYMBOL\", \"expr\", \"EQ_ASSIGN\", > \"NUM_CONST\", \"expr\")" > [8] "parseData = c(FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, > TRUE, TRUE, FALSE)" > [9] "parseData = c(\"y...
2013 Sep 18
1
getParseData() for imaginary numbers
...gone in the 'text' column in the returned data frame from getParseData(), e.g. in the example below, perhaps the text should be 1i instead of 1: > p=parse(text='1i') > getParseData(p) line1 col1 line2 col2 id parent token terminal text 1 1 1 1 2 1 2 NUM_CONST TRUE 1 2 1 1 1 2 2 0 expr FALSE > sessionInfo() R version 3.0.1 (2013-05-16) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_M...
2013 Jul 05
3
should the text for RIGHT_ASSIGN be -> in getParseData()?
...olumn for '->' becomes '<-' in the data frame returned by getParseData(): > getParseData(parse(text='1->x')) line1 col1 line2 col2 id parent token terminal text 7 1 1 1 4 7 0 expr FALSE 1 1 1 1 1 1 2 NUM_CONST TRUE 1 2 1 1 1 1 2 7 expr FALSE 3 1 2 1 3 3 7 RIGHT_ASSIGN TRUE <- 4 1 4 1 4 4 6 SYMBOL TRUE x 6 1 4 1 4 6 7 expr FALSE Is that expected? > sessionInfo() R version...
2015 Jul 29
3
Mapping parse tree elements to tokens
...( > 11 1 6 1 10 11 13 expr FALSE > 5 1 6 1 6 5 7 SYMBOL TRUE y > 7 1 6 1 6 7 11 expr FALSE > 6 1 8 1 8 6 11 '+' TRUE + > 8 1 10 1 10 8 9 NUM_CONST TRUE 1 > 9 1 10 1 10 9 11 expr FALSE > 10 1 11 1 11 10 13 ')' TRUE ) > > > Now p is an expression, with the parse tree in p[[1]]. From the table, we > can see that the root node has id 15, and 3 nodes have that...
2015 Jul 29
2
Mapping parse tree elements to tokens
I would like to map the parsed tokens obtained from utils::getParseData() to the parse tree and elements obtained by base::parse(). It looks like back when this code was in the parser package the parse() function annotated the elements in the tree with their id, which would allow you to perform this mapping. However when the code was included in R this functionality was removed. ?getParseData
2015 Jul 29
2
Mapping parse tree elements to tokens
...11 13 expr FALSE >> > 5 1 6 1 6 5 7 SYMBOL TRUE y >> > 7 1 6 1 6 7 11 expr FALSE >> > 6 1 8 1 8 6 11 '+' TRUE + >> > 8 1 10 1 10 8 9 NUM_CONST TRUE 1 >> > 9 1 10 1 10 9 11 expr FALSE >> > 10 1 11 1 11 10 13 ')' TRUE ) >> > >> > >> > Now p is an expression, with the parse tree in p[[1]]. From the table, >> > we >&...
2015 Jul 29
0
Mapping parse tree elements to tokens
...'(' TRUE ( 11 1 6 1 10 11 13 expr FALSE 5 1 6 1 6 5 7 SYMBOL TRUE y 7 1 6 1 6 7 11 expr FALSE 6 1 8 1 8 6 11 '+' TRUE + 8 1 10 1 10 8 9 NUM_CONST TRUE 1 9 1 10 1 10 9 11 expr FALSE 10 1 11 1 11 10 13 ')' TRUE ) Now p is an expression, with the parse tree in p[[1]]. From the table, we can see that the root node has id 15, and 3 nodes have that as a parent. Those would...
2019 Jul 05
0
parse() drops parse data when encountering `` (bug?)
...> 8 1 1 1 7 8 0 equal_assign FALSE #> 1 1 1 1 3 1 3 SYMBOL TRUE foo #> 3 1 1 1 3 3 8 expr FALSE #> 2 1 5 1 5 2 8 EQ_ASSIGN TRUE = #> 4 1 7 1 7 4 5 NUM_CONST TRUE 1 #> 5 1 7 1 7 5 8 expr FALSE #> 6 1 9 1 9 6 0 '{' TRUE { sessionInfo() #> R version 3.6.0 (2019-04-26) #> Platform: x86_64-pc-linux-gnu (64-bit) #> Running under: Pop!_OS 18.10 #> #> Matrix...
2020 Jan 17
0
A bug understanding F relative to FALSE?
...( > ## 4 1 3 1 3 4 6 SYMBOL TRUE F > ## 6 1 3 1 3 6 14 expr FALSE > ## 5 1 4 1 4 5 14 ',' TRUE , > ## 9 1 5 1 9 9 10 NUM_CONST TRUE FALSE > ## 10 1 5 1 9 10 14 expr FALSE > ## 11 1 10 1 10 11 14 ')' TRUE ) > > I would expect that token for F is the same as token for FALSE. > > > Thank you! > > Iago > >...
2015 Jul 29
1
Mapping parse tree elements to tokens
...11 13 expr FALSE >> > 5 1 6 1 6 5 7 SYMBOL TRUE y >> > 7 1 6 1 6 7 11 expr FALSE >> > 6 1 8 1 8 6 11 '+' TRUE + >> > 8 1 10 1 10 8 9 NUM_CONST TRUE 1 >> > 9 1 10 1 10 9 11 expr FALSE >> > 10 1 11 1 11 10 13 ')' TRUE ) >> > >> > >> > Now p is an expression, with the parse tree in p[[1]]. From the table, >> we >> &...
2015 Jul 29
0
Mapping parse tree elements to tokens
...6 1 10 11 13 expr FALSE > > 5 1 6 1 6 5 7 SYMBOL TRUE y > > 7 1 6 1 6 7 11 expr FALSE > > 6 1 8 1 8 6 11 '+' TRUE + > > 8 1 10 1 10 8 9 NUM_CONST TRUE 1 > > 9 1 10 1 10 9 11 expr FALSE > > 10 1 11 1 11 10 13 ')' TRUE ) > > > > > > Now p is an expression, with the parse tree in p[[1]]. From the table, we > > can see that the root node ha...
2015 Jul 29
0
Mapping parse tree elements to tokens
...xpr FALSE >>> > 5 1 6 1 6 5 7 SYMBOL TRUE y >>> > 7 1 6 1 6 7 11 expr FALSE >>> > 6 1 8 1 8 6 11 '+' TRUE + >>> > 8 1 10 1 10 8 9 NUM_CONST TRUE 1 >>> > 9 1 10 1 10 9 11 expr FALSE >>> > 10 1 11 1 11 10 13 ')' TRUE ) >>> > >>> > >>> > Now p is an expression, with the parse tree in p[[1]]. From the table, &g...